Skip to content

Commit

Permalink
bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nemoTyrant committed Nov 11, 2014
1 parent 5694b00 commit fbb2b04
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions func.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function crawl(){
$html .= '<form>';
$html .= "标题:<input type='text' name='title' value='{$val['title']}'><br>";
$html .= "描述:<input type='text' name='desc' value='{$val['desc']}'><br>";
$html .= "地址:<input type='text' name='href' value='{$val['href']}'><br>";
$html .= "地址:<input type='text' name='href' value='{$val['href']}'><button class='openurl'>打开</button><br>";
$html .= "<input type='hidden' name='id' value='{$val['id']}'>";
$html .= "<input type='hidden' name='number' value='{$val['number']}'>";
$html .= "<input type='text' class='newcate' name='newcate''>";
Expand Down Expand Up @@ -234,7 +234,7 @@ function crawl($number){
mylog('crawl finished.start parsing');
$data=array();
foreach ($matches[1] as $key => $val) {
if(false !== strpos($matches[3][$key], 'job')){
if(false !== strpos($matches[1][$key], 'job')){
continue;
}
$item=[
Expand All @@ -247,7 +247,7 @@ function crawl($number){
//加入数据库
$id=$this->add_cache($item);
$item['id']=$id;
mylog('item added to cache');
mylog("item {$id} added to cache");
// 加入数组
$data[]=$item;
}
Expand Down
9 changes: 8 additions & 1 deletion manong.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function updateCategory(cate){
}else{
alert(rs.msg);
}
_this.text('添加');
});
e.preventDefault();
});
Expand All @@ -96,12 +97,18 @@ function updateCategory(cate){
$.getJSON('index.php?a=del',{id:id},function(rs){
if(rs.res){
_this.closest('.item').hide(200);
updateCategory(rs.cate);
}else{
alert('删除失败');
}
});
e.preventDefault();
});
// 打开
$('#content').on('click','.openurl',function(){
var url=$(this).prev().val();
window.open(url,'_blank');
return false;
});
</script>
</html>

0 comments on commit fbb2b04

Please sign in to comment.