File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ function crawl(){
81
81
$ html .= '<form> ' ;
82
82
$ html .= "标题:<input type='text' name='title' value=' {$ val ['title ' ]}'><br> " ;
83
83
$ 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> " ;
85
85
$ html .= "<input type='hidden' name='id' value=' {$ val ['id ' ]}'> " ;
86
86
$ html .= "<input type='hidden' name='number' value=' {$ val ['number ' ]}'> " ;
87
87
$ html .= "<input type='text' class='newcate' name='newcate''> " ;
@@ -234,7 +234,7 @@ function crawl($number){
234
234
mylog ('crawl finished.start parsing ' );
235
235
$ data =array ();
236
236
foreach ($ matches [1 ] as $ key => $ val ) {
237
- if (false !== strpos ($ matches [3 ][$ key ], 'job ' )){
237
+ if (false !== strpos ($ matches [1 ][$ key ], 'job ' )){
238
238
continue ;
239
239
}
240
240
$ item =[
@@ -247,7 +247,7 @@ function crawl($number){
247
247
//加入数据库
248
248
$ id =$ this ->add_cache ($ item );
249
249
$ item ['id ' ]=$ id ;
250
- mylog (' item added to cache ' );
250
+ mylog (" item { $ id } added to cache" );
251
251
// 加入数组
252
252
$ data []=$ item ;
253
253
}
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ function updateCategory(cate){
84
84
}else {
85
85
alert (rs . msg );
86
86
}
87
+ _this . text (' 添加' );
87
88
} );
88
89
e.preventDefault();
89
90
});
@@ -96,12 +97,18 @@ function updateCategory(cate){
96
97
$. getJSON (' index.php?a=del' ,{id :id },function (rs ){
97
98
if (rs . res ){
98
99
_this . closest (' .item' ). hide (200 );
99
- updateCategory (rs . cate );
100
100
}else {
101
101
alert (' 删除失败' );
102
102
}
103
103
} );
104
104
e.preventDefault();
105
105
});
106
+
107
+ // 打开
108
+ $('#content').on('click','.openurl',function(){
109
+ var url = $(this ). prev (). val ();
110
+ window . open (url ,' _blank' );
111
+ return false ;
112
+ } );
106
113
</script >
107
114
</html >
You can’t perform that action at this time.
0 commit comments