Skip to content

Commit fbb2b04

Browse files
committed
bugs fixed
1 parent 5694b00 commit fbb2b04

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

func.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function crawl(){
8181
$html .= '<form>';
8282
$html .= "标题:<input type='text' name='title' value='{$val['title']}'><br>";
8383
$html .= "描述:<input type='text' name='desc' value='{$val['desc']}'><br>";
84-
$html .= "地址:<input type='text' name='href' value='{$val['href']}'><br>";
84+
$html .= "地址:<input type='text' name='href' value='{$val['href']}'><button class='openurl'>打开</button><br>";
8585
$html .= "<input type='hidden' name='id' value='{$val['id']}'>";
8686
$html .= "<input type='hidden' name='number' value='{$val['number']}'>";
8787
$html .= "<input type='text' class='newcate' name='newcate''>";
@@ -234,7 +234,7 @@ function crawl($number){
234234
mylog('crawl finished.start parsing');
235235
$data=array();
236236
foreach ($matches[1] as $key => $val) {
237-
if(false !== strpos($matches[3][$key], 'job')){
237+
if(false !== strpos($matches[1][$key], 'job')){
238238
continue;
239239
}
240240
$item=[
@@ -247,7 +247,7 @@ function crawl($number){
247247
//加入数据库
248248
$id=$this->add_cache($item);
249249
$item['id']=$id;
250-
mylog('item added to cache');
250+
mylog("item {$id} added to cache");
251251
// 加入数组
252252
$data[]=$item;
253253
}

manong.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function updateCategory(cate){
8484
}else{
8585
alert(rs.msg);
8686
}
87+
_this.text('添加');
8788
});
8889
e.preventDefault();
8990
});
@@ -96,12 +97,18 @@ function updateCategory(cate){
9697
$.getJSON('index.php?a=del',{id:id},function(rs){
9798
if(rs.res){
9899
_this.closest('.item').hide(200);
99-
updateCategory(rs.cate);
100100
}else{
101101
alert('删除失败');
102102
}
103103
});
104104
e.preventDefault();
105105
});
106+
107+
// 打开
108+
$('#content').on('click','.openurl',function(){
109+
var url=$(this).prev().val();
110+
window.open(url,'_blank');
111+
return false;
112+
});
106113
</script>
107114
</html>

0 commit comments

Comments
 (0)