1var d = document; 2var alreadySelect = 0; 3var tourl = d.location.href; 4var subject = encodeURI(d.title); 5var appsUrl = "https://apps.99.com.cn/"; 6var pollUrl = "https://my.99.com.cn/"; 7var ch_id; 8 9 10if(/Android|webOS|iPhone|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent) && document.cookie.indexOf('LOCATION_FROM_MOBILE')==-1){ 11 var url,turl,filename, aid, tmp; 12 url = document.location.href; 13 14 if (url == 'https://www.99.com.cn' || url == 'https://www.99.com.cn/' || url.indexOf('www.99.com.cn/?')>0 || url == 'https://99.com.cn' || url == 'https://99.com.cn/' || url.indexOf('99.com.cn/?')>0) { 15 window.location.href="https://m.99.com.cn/"; 16 } else { 17 18 if (url.indexOf('.htm')>0 && !RegText(/\/(\d+)-(\d+).(html|htm)$/ig,url) && url.indexOf('list_')==-1 && url.indexOf('index.htm')==-1) { 19 20 turl = url.split('/');filename = turl[turl.length-1]; 21 if (filename.indexOf('_')>0) { 22 tmp = filename.split('_'); 23 } else { 24 tmp = filename.split('.'); 25 } 26 aid = tmp[0]; 27 window.location.href = 'https://m.99.com.cn/a/'+aid+'/'; 28 } else { 29 if(!ch_id){ 30 window.location.href='https://m.99.com.cn/'; 31 }else{ 32 //window.location.href="https://m.99.com.cn/goto/?url="+decodeURIComponent(window.location.href); 33 window.location.href='https://m.99.com.cn/ch/'+ch_id+'/'; 34 } 35 } 36 } 37} 38 39function RegText(re, v){ 40 var s1; 41 if (re.test(v)) 42 return true; 43 else 44 return false; 45} 46 47var detail = { 48 49 init : function () 50 { 51 this.initReviewArt('.recommend_left'); 52 this.initBrowserByPhone(); 53 this.GetMeHightPV(); 54 }, 55 56 GetMeHightPV : function() { 57 var imgs = $(".detail_con").find("img").each(function(i){ 58 59 if(tourl==null||tourl.indexOf('jkzx.99.com.cn')>0) 60 return; 61 62 var domain = /http:\/\/.*?\/[^\d]*\//ig.exec(tourl); 63 var pic_tips = '<div class="clidk_next"></div>'; 64 65 if (jQuery('.clidk_next').length == 0) { 66 jQuery('body').append(pic_tips); 67 } 68 69 jQuery('.clidk_next').hide(); 70 71 72 $(this).bind('mouseover',function(){ 73 74 var selfTop = jQuery(this).offset().top; 75 var selfleft = jQuery(this).offset().left; 76 var selfWidth = jQuery(this).width(); 77 78 var top = selfTop; 79 var left = selfleft+selfWidth-170; 80 81 jQuery('.clidk_next').css({'top':top+'px','left':left+'px'}); 82 jQuery('.clidk_next').show(); 83 jQuery('.clidk_next').bind('mouseover',function(){jQuery(this).show()}); 84 jQuery('.clidk_next').bind('mouseout',function(){jQuery(this).hide()}); 85 }); 86 87 $(this).bind('mouseout', function(){ jQuery('.clidk_next').hide(); }); 88 89 if ("undefined" != typeof(nextarc)){ 90 domain = nextarc; 91 } 92 93 if ($("#nextpage").length>0) { 94 if($("#nextpage").attr("href")=="#") 95 { 96 url="#"; 97 if (url=="#") url = domain; 98 } 99 else 100 { 101 url = $("#nextpage").attr("href"); 102 } 103 } else { 104 url = domain; 105 } 106 107 //img title&alt time:2015/6/2 108 var zlis =''; 109 //$(this).attr("alt","µã»÷ͼƬ²é¿´ÏÂÒ»Ò³"); 110 $(this).attr("title",$(".title h1").html()); 111 //var lis = document.getElementsByName("keywords").content; 112 var keywords = document.getElementsByTagName('meta')['keywords'].content; 113 var alt_key = keywords.replace(/,/g, " "); 114 $(this).attr("alt",alt_key); 115 116 117 if ($(this).parent().get(0).tagName!='A') { 118 $(this).wrap("<a href=\""+ url +"\" title=\"µã»÷ͼƬ²é¿´ÏÂÒ»Ò³\"></a>"); 119 } else { 120 $(this).parent().attr("target","_self"); 121 $(this).parent().attr("href",url); 122 } 123 }); 124 125 var newsimgs = $(".detail_con").find("img").each(function(i){ 126 127 var domain = /http:\/\/.*?\/[^\d]*\//ig.exec(tourl); 128 129 if ("undefined" != typeof(nextarc)){ 130 domain = nextarc; 131 } 132 133 if ($("#nextpage").length>0) { 134 if($("#nextpage").attr("href")=="#") 135 { 136 url="#"; 137 if (url=="#") url = domain; 138 } 139 else 140 { 141 url = $("#nextpage").attr("href"); 142 } 143 } else { 144 url = domain; 145 } 146 147 //$(this).attr("alt","µã»÷ͼƬ²é¿´ÏÂÒ»Ò³"); 148 if ($(this).parent().get(0).tagName!='A') { 149 $(this).wrap("<a href=\""+ url +"\" title=\"µã»÷ͼƬ²é¿´ÏÂÒ»Ò³\"></a>"); 150 } else { 151 $(this).parent().attr("target","_self"); 152 $(this).parent().attr("href",url); 153 } 154 }); 155 156 $('#nextpage').bind('click', function(){ 157 var domain = /http:\/\/.*?\/[^\d]*\//ig.exec(tourl); 158 var url=$("#nextpage").attr("href"); 159 if($("#nextpage").attr("href")=="#") 160 { 161 if ("undefined" != typeof(nextarc)){ 162 url = nextarc; 163 } 164 else{ 165 url=domain; 166 } 167 } 168 169 window.location.href = url; 170 }) 171 }, 172 173 initBrowserByPhone : function () { 174 175 var title = jQuery('.title').find('h1').text(); 176 if (jQuery('.by_phone').length > 0) { 177 jQuery('.by_phone').append('<a class="phone_ico J_show_phone" href="javascript:;"></a>'); 178 jQuery('.by_phone').append('<div class="by_phone_detial hidden"></div>'); 179 jQuery('.by_phone_detial').append('<h2><span>ÊÖ»úɨÃè¶þάÂë£¬ËæÉí·ÔĽ¡¿µ×ÊѶ</span><a href="javascript:;" class="ico_close J_close_phone"></a></h2>'); 180 jQuery('.by_phone_detial').append('<div class="by_p_con cc"></div>'); 181 jQuery('.by_p_con').append('<div class="by_p_left"></div><div class="img_p_weixin"><img src="'+ pollUrl +'index.php?m=Publics&a=qrcode&url='+ decodeURI('http://mobile.99.com.cn/?url=' + decodeURI(window.location)) +'&rand='+ Math.random() +'" /></div>'); 182 jQuery('.by_p_left').append('<p>ÓÃ΢ÐÅɨÃè¶þάÂ룬ÔÚÊÖ»úÉϼÌÐøÔĶÁ´ËÎÄÕ¡£</p>'); 183 jQuery('.by_p_left').append('<p>ÎÄÕ£º<a href="'+ window.location +'" target="_blank">'+ title +'</a></p>'); 184 jQuery('.by_p_left').append('<p>ÒÑÔĶÁÖÁµÚ '+ curpage +' Ò³</p>'); 185 jQuery('.by_p_left').append('<p>ɨÃè¶þάÂ룬·ÖÏí½¡¿µ×ÊѶ£¡</p>'); 186 187 jQuery('.J_show_phone').bind('click',function(){ 188 if (!jQuery('.by_phone_detial').is(':hidden')) { 189 jQuery('.by_phone_detial').hide(); 190 } else { 191 jQuery('.by_phone_detial').show(); 192 } 193 }) 194 195 jQuery('.J_close_phone').bind('click',function(){ 196 jQuery('.by_phone_detial').hide(); 197 }) 198 } 199 200 }, 201 202 initReviewArt : function (obj) 203 { 204 var _this = this; 205 var aid = jQuery('a.J_review_btn').attr('aid'); 206 if ('yes' == jQuery.cookie('likeon'+aid)) { 207 jQuery('.J_like_tip').text('ÄúÒÑÆÀ¼Û£¬Ð»Ð»£¡'); 208 jQuery('.J_review_btn').addClass('gray'); 209 jQuery('.J_review_btn').removeAttr('href'); 210 } 211 jQuery('a.J_review_btn').bind('click', function(){ 212 if ('yes' == jQuery.cookie('likeon'+aid)){ 213 return false;
214 } 215 jQuery.ajax({ 216 type: "GET",//ʹÓÃget·½·¨·ÃÎʺǫ́ 217 dataType: "jsonp", 218 jsonp: 'callback', 219 url: appsUrl + 'apps.php?m=review', 220 data: "aid="+aid,//Òª·¢Ë͵ÄÊý¾Ý 221 complete :function(){}, 222 success: function(data){//dataΪ·µ»ØµÄÊý¾Ý£¬ÔÚÕâÀï×öÊý¾Ý°ó¶¨ 223 if (data.status == 'ok') { 224 _this.show(obj, '+1'); 225 } else { 226 _this.show(obj, 'Çë²»ÒªÖØ¸´ÆÀ¼Û'); 227 } 228 jQuery.cookie('likeon'+aid, 'yes', {expires: 365}) 229 $('.J_like_tip').text('ÄúÒÑÆÀ¼Û£¬Ð»Ð»£¡'); 230 jQuery('.J_review_btn').addClass('gray'); 231 jQuery('.J_review_btn').removeAttr('href'); 232 } 233 }); 234 return false; 235 }); 236 }, 237 238 changeBlock : function (id, con_id, titClass, titTag, focusClass) { 239 var obj_tit = id + ' .'+titClass; 240 var obj_con = id + ' .'+con_id; 241 //$(this).click((function(k){ 242 $(obj_tit).find(titTag).each(function(i){ 243 $(this).mouseover((function(k){ 244 return function(){ 245 $(obj_con).hide(); 246 $(obj_con).eq(k).show(); 247 $(obj_tit).find(titTag).removeClass(focusClass); 248 $(obj_tit).find(titTag).eq(k).addClass(focusClass); 249 } 250 })(i)); 251 }); 252 }, 253 254 show : function (obj, text) { 255 var wangB = $(obj); 256 var spNum = parseInt(wangB.find('.J_like_count').text()); 257 wangB.find(".float").text(text); 258 wangB.find(".float").css("display", "none").css("top", "-55px"); 259 wangB.find(".float").css("display", "block").animate({ 260 top: [-100, "swing"] 261 }, 600, function(){ 262 $(this).fadeOut(600); 263 }); 264 wangB.find('.J_like_count').text(spNum+1); 265 }, 266 267 chkLoginStatus : function(){ 268 if ('loginon' != login_status && login_uid == '' && login_user == '') { 269 showLogin(); 270 return false; 271 } 272 return true; 273 }, 274 275 doSiderFix : function (obj, footAllHeigh) { 276 var l = true; 277 var x = $(obj).offset(); 278 var topval = x.top; 279 var main_h = jQuery('.con_left').height(); 280 var side_h = jQuery('.con_right').height(); 281 if ('undefined' == typeof(document.body.style.maxHeight)) return false; 282 function doFix() 283 { 284 var win_height = $(window).height(); 285 var scrolla=$(window).scrollTop(); 286 var mintop = parseInt(win_height) - parseInt($(obj).height())-parseInt(footAllHeigh); 287 var dis = parseInt(topval)-parseInt(scrolla); 288 289 $(obj).css({'top':mintop +'px'}); 290 if(l && dis<=0) 291 { 292 if (side_h < main_h) 293 { 294 $(obj).removeClass().addClass("fixed_right"); 295 } 296 l=false; 297 } 298 299 if(!l && dis>0) 300 { 301 $(obj).removeClass("fixed_right"); 302 l=true; 303 } 304 305 } 306 $(window).scroll(doFix); 307 }, 308 309 loadTips : function(obj){ 310 jQuery(obj).bind('mouseover', function(){ 311 var kid = jQuery(this).attr('kid'); 312 var selfTop = jQuery(this).offset().top; 313 var selfleft = jQuery(this).offset().left; 314 var selfHeight = jQuery(this).height(); 315 var height = jQuery(window).height(); 316 var scrollTop = $(window).scrollTop(); 317 var box = jQuery('#box_'+kid); 318 jQuery('body').stopTime('kwdtip_'+kid); 319 box.show(); 320 321 var sourceTop = parseInt(selfTop-box.height()-5); 322 var bottomTop = parseInt(selfTop+selfHeight+5); 323 var currTop = sourceTop; 324 325 currtop = (sourceTop+box.height())-scrollTop < box.height() ? bottomTop : sourceTop; 326 327 box.css({'top':currtop+'px','left':selfleft+'px'}); 328 if (jQuery('#box_'+kid).find('.extra').find('.tj_hos').length==0 && jQuery('#box_'+kid).find('.extra').find('.tj_doc').length==0) detail.getTipExtraInfo(kid); 329 330 331 }); 332 333 334 jQuery('.tips').bind('mouseout', function(){ 335 var kid = jQuery(this).attr('kid'); 336 var kwapp = 'kwdtip_'+kid; 337 var box = jQuery('#box_'+kid); 338 var selfTop = jQuery(this).offset().top; 339 var selfleft = jQuery(this).offset().left; 340 var selfHeight = jQuery(this).height(); 341 var height = jQuery(window).height(); 342 var scrollTop = $(window).scrollTop(); 343 344 var sourceTop = parseInt(selfTop-box.height()-5); 345 var bottomTop = parseInt(selfTop+selfHeight+5); 346 var currTop = sourceTop; 347 348 currtop = (sourceTop+box.height())-scrollTop < box.height() ? bottomTop : sourceTop; 349 350 jQuery('body').stopTime(kwapp); 351 jQuery('body').everyTime('2ds',kwapp,function(){ 352 jQuery('body').stopTime(kwapp); 353 box.hide(); 354 },0,true); 355 356 box.bind('mouseover', function(){ 357 jQuery('body').stopTime(kwapp); 358 box.show(); 359 box.css({'top':currtop+'px','left':selfleft+'px'}); 360 if (jQuery('#box_'+kid).find('.extra').find('.tj_hos').length==0 && jQuery('#box_'+kid).find('.extra').find('.tj_doc').length==0) detail.getTipExtraInfo(kid); 361 }) 362 363 box.bind('mouseout', function(){ 364 jQuery('body').stopTime(kwapp); 365 jQuery('body').everyTime('2ds',kwapp,function(){ 366 box.hide(); 367 },0,true); 368 }) 369 }); 370 }, 371 372 getTipExtraInfo : function (kid) { 373 jQuery.ajax({ 374 type: "GET",//ʹÓÃget·½·¨·ÃÎʺǫ́ 375 dataType: "jsonp", 376 jsonp: 'callback', 377 url: appsUrl+"apps.php?m=tips", 378 data: "kid="+kid,//Òª·¢Ë͵ÄÊý¾Ý 379 complete :function(){}, 380 success: function(data){//dataΪ·µ»ØµÄÊý¾Ý£¬ÔÚÕâÀï×öÊý¾Ý°ó¶¨ 381 jQuery('#box_'+kid).find('.extra').html(data.html); 382 if (jQuery('#box_'+kid).find('div').eq(0).attr('class') == 'extra'){ 383 jQuery('#box_'+kid).find('div').eq(0).find('div').eq(0).css('background-image','none'); 384 } else { 385 jQuery('#box_'+kid).find('div').eq(0).css('background-image','none'); 386 } 387 } 388 }) 389 }, 390 391 slideObj : function(id, con_id, tab) { 392 var obj_tit = id + ' h2'; 393 var obj_con = id + ' '+con_id; 394 $(obj_tit).find(tab).each(function(i){ 395 $(this).mouseover((function(k){ 396 return function(){ 397 $(obj_con).hide(); 398 $(obj_con).eq(k).show(); 399 $(obj_tit).find(tab).removeClass('on'); 400 $(obj_tit).find(tab).eq(k).addClass('on'); 401 } 402 })(i)); 403 }); 404 } 405 406 407 408}; 409 410 411function loadPoll(pid, code) { 412 413 jQuery('#pollbox').html('Í¶Æ±ÔØÈëÖÐ...'); 414 415 var pollHtml = ''; 416 jQuery.ajax({ 417 type: "GET",//ʹÓÃget·½·¨·ÃÎʺǫ́ 418 dataType: "jsonp", 419 jsonp: 'callback', 420 url: pollUrl + "index.php?m=Poll&a=ajax&type=getspoll&api_id=4&code="+code, 421 data: "pid="+pid,//Òª·¢Ë͵ÄÊý¾Ý 422 complete :function(){}, 423 success: function(data){//dataΪ·µ»ØµÄÊý¾Ý£¬ÔÚÕâÀï×öÊý¾Ý°ó¶¨ 424 checkcode = data.maxchoice>1 ? ' onclick="checkSelect(this.checked,'+ data.maxchoice +')"' : ''; 425 pollHtml = '<form name="votingform" method="post" action="'+ pollUrl +'index.php?m=Poll&a=voting&pid='+ data.pid +'" target="_blank" onsubmit="return votecheck();">' 426 pollHtml += '<ol>' 427 for(var i=0; i<data.option.length; i++) { 428 pollHtml += ' <li>'; 429 pollHtml += ' <p>'+ (i+1) +'. '+ data.option[i].option +'</p>'; 430 pollHtml += ' <div class="votebar votebar-'+ (i+1) +'"><em style="width:'+ data.option[i].percent +'%;"> </em></div>'; 431 pollHtml += ' <div class="voterecord">'+ data.option[i].votenum +' <span class="tint">('+ data.option[i].percent +'%)</span></div>'; 432 pollHtml += ' <div class="voteinput"><input type="'+ data.opttype +'" class="pollopt" name="option[]" autocomplete="off" value="'+ data.option[i].optid +'"'+ checkcode +' /></div>'; 433 pollHtml += ' </li>'; 434 } 435 pollHtml += '</ol>' 436 pollHtml += ' <p>' 437 pollHtml += ' <input type="submit" name="votingsubmit" id="votingsubmit" class="btn3" value="ÎÒҪͶƱ" />'
438 pollHtml += ' <span>ͶƱÈËÊý£º<b>'+ data.person +'</b>ÈË£¨<a href="'+ pollUrl +'index.php?m=Poll&a=view&pid='+ data.pid +'" target="_blank">µã»÷²é¿´</a>£©</span>' 439 pollHtml += ' </p>' 440 pollHtml += '</form>'; 441 jQuery('#pollbox').html(pollHtml); 442 jQuery(function(){ 443 jQuery('.pollopt').removeAttr("checked"); 444 }) 445 } 446 }); 447} 448 449 450function votecheck(){ 451 var checked = 0; 452 453 var oObj = document.getElementsByName("option[]"); 454 for(i=0; i < oObj.length; i++) { 455 if(oObj[i].checked) { 456 checked++; 457 } 458 } 459 if (checked==0) { alert('ÄúûÓÐÑ¡ÔñҪͶƱµÄÑ¡Ïî'); return false;} 460} 461 462function getchoices(){ 463 var checked = 0; 464 465 var oObj = document.getElementsByName("option[]"); 466 for(i=0; i < oObj.length; i++) { 467 if(oObj[i].checked) { 468 checked++; 469 } 470 } 471 return checked; 472} 473 474function checkSelect(sel, maxSelect) { 475 if (alreadySelect<0) alreadySelect = 0; 476 var count = getchoices(); 477 alreadySelect = count; 478 if(sel) { 479 if(alreadySelect == maxSelect) { 480 var oObj = document.getElementsByName("option[]"); 481 for(i=0; i < oObj.length; i++) { 482 if(!oObj[i].checked) { 483 oObj[i].disabled = true; 484 } 485 } 486 } 487 } else { 488 if(alreadySelect < maxSelect) { 489 var oObj = document.getElementsByName("option[]"); 490 for(i=0; i < oObj.length; i++) { 491 if(oObj[i].disabled) { 492 oObj[i].disabled = false; 493 } 494 } 495 } 496 } 497} 498 499function fun_tips(id, con_id) { 500 var obj_tit = id + ' h2'; 501 var obj_con = id + ' '+con_id; 502 $(obj_tit).find('li').each(function(i){ 503 $(this).mouseover((function(k){ 504 return function(){ 505 $(obj_con).hide(); 506 $(obj_con).eq(k).show(); 507 $(obj_tit).find('li').removeClass('on'); 508 $(obj_tit).find('li').eq(k).addClass('on'); 509 } 510 })(i)); 511 }); 512} 513 514function loadHealthServerJS(){ 515 jQuery('.server_left').find('li').each(function(i){ 516 jQuery(this).mouseover((function(k){ 517 return function(){ 518 jQuery('.right_jb').hide(); 519 jQuery('.right_jb').eq(k).show(); 520 jQuery(".server_left").find('li').removeClass('now'); 521 jQuery(".server_left").find('li').eq(k).addClass('now'); 522 } 523 })(i)); 524 }); 525} 526 527function loadFollowSiderBar() { 528 529 var advisory_inner = '';
530 // document.write('<div id="moquu_wxin" class="moquu_wxin"><a href="http://www.rxys.com" target="_blank"><span href="javascript:void(0)">ÈÈÐÄÒ½Éú</span><div class="moquu_wxinh"></div></a></div>'); 531 document.write('<div class="right_share_ico">'); 532 document.write(' <a href="https://m.99.com.cn/api/jd/doclist.html" class="J_advisory_btn" title="×Éѯ"><p class="ico_advisory"></p></a><a href="javascript:;" class="J_gotop" title="»Øµ½¶¥²¿" style="display:none;"><p class="ico_top"></p></a>'); 533 document.write('</div>'); 534 535 if('undefined' == typeof(document.body.style.maxHeight)) { 536 $('.right_share_ico').css({'position':'absolute'}); 537 var win_height = $(window).height(); 538 var obj_height = $('.right_share_ico').height(); 539 var mintop = parseInt(win_height) - parseInt(obj_height); 540 scroll_Div('.right_share_ico', mintop); 541 } 542 543 //»Øµ½¶¥²¿ 544 $('.J_gotop').bind('click', function() { 545 $("html, body").animate({ scrollTop: 0 }, 200); 546 }); 547 548 var backToTopFunc = function(){ 549 var st = $(document).scrollTop(), winh = $(window).height(); 550 if (st > 0) { 551 $('.J_gotop').show(); 552 } else { 553 $('.J_gotop').hide(); 554 } 555 } 556 557 $(window).bind("scroll", backToTopFunc); 558 559 //ÊÕ²ØÎÄÕ 560 $('.J_collect_btn').bind('click', function(){ 561 562 563 if (true != detail.chkLoginStatus()) return false; 564 565 var title = jQuery('.title').find('h1').text(); 566 var arcurl = document.location; 567 568 jQuery.ajax({ 569 type: "GET",//ʹÓÃget·½·¨·ÃÎʺǫ́ 570 dataType: "jsonp", 571 jsonp: 'callback', 572 url: appsUrl + 'apps.php?m=collect&rand='+Math.random(), 573 data: "title="+decodeURI(title)+"&url="+decodeURI(arcurl),//Òª·¢Ë͵ÄÊý¾Ý 574 complete :function(){}, 575 success: function(data){//dataΪ·µ»ØµÄÊý¾Ý£¬ÔÚÕâÀï×öÊý¾Ý°ó¶¨ 576 577 if (data.status == 'onlogin') { 578 showLogin(); 579 return false; 580 } else { 581 var msg; 582 if (data.status == 'isok') { 583 msg = '<p><span>Êղسɹ¦£¡</span></p><p><a class="click_look" href="https://home.99.com.cn/ufavorite.aspx?appid=1" target="_blank">µã»÷²é¿´ÎÒµÄÊÕ²Ø >></a></p>'; 584 } else { 585 var errcode = 'ÊÕ²ØÎÄÕÂʧ°Ü£¡'; 586 var linkcode = '<a class="click_look" href="https://home.99.com.cn/ufavorite.aspx?appid=1" target="_blank" onclick="dialog.closeDialog();">²é¿´Á´½Ó</a>'; 587 switch(data.resultvalue) { 588 case '0' : 589 errcode = 'ÊÕ²ØÎÄÕÂʧ°Ü'; 590 break; 591 case '-1' : 592 errcode = '²»³äÐíÊÕ²Ø'; 593 break; 594 case '-2' : 595 errcode = 'ÄúÒÑÊղظÃÎÄÕÂÁË'; 596 break; 597 } 598 msg = '<p><span class="error">'+ errcode +'</span></p><p>'+ linkcode +'</p>'; 599 } 600 601 dialog.showMsgBox({ 602 w : 380, 603 h : 260, 604 inner : msg, 605 dlgCls : 'prompt', 606 dlgInnerCls : 'prompt_con' 607 }, '1.0'); 608 } 609 610 } 611 }); 612 613 }); 614 615 //×Éѯ 616 $('.J_advisory_btn').bind('click', function(){ 617 618 if (true != detail.chkLoginStatus()) return false; 619 620 var def_title = jQuery.cookie('ask_title') ? jQuery.cookie('ask_title') : '¹ØÓÚ'+ curkey; 621 var def_content = jQuery.cookie('ask_content') ? jQuery.cookie('ask_content') : ''; 622 623 advisory_inner = ' <form id="advisoryBody" action="'+ appsUrl +'apps.php?m=advisory" method="post">'; 624 advisory_inner += ' <p><span>ÎÊÌ⣺</span><input type="text" class="zx_title" value="'+ def_title +'" /></p>'; 625 advisory_inner += ' <p><span>ÏêϸÃèÊö£º</span><textarea class="zx_content">'+ def_content +'</textarea></p>'; 626 advisory_inner += ' <p><span></span><input class="submit_btn J_advisory_submit" type="button" value="Ìá½»" /><input class="submit_btn J_advisory_cancel" type="button" value="È¡Ïû" /></p>'; 627 advisory_inner += ' </form>'; 628 629 dialog.showCustom({ 630 w : 380, 631 h : 260, 632 tit : 'ÎÒÒª×Éѯ', 633 inner : advisory_inner, 634 dlgCls : 'advisory', 635 dlgInnerCls : 'advisory_con' 636 }); 637 638 //È¡ÏûÌá½» 639 $('.J_advisory_cancel').bind('click', function(){ 640 var title = jQuery('.zx_title').val(); 641 var content = jQuery('.zx_content').val(); 642 jQuery.cookie('ask_title', title, {}) 643 jQuery.cookie('ask_content', content, {}) 644 dialog.closeDialog(); 645 }) 646 647 //Ìá½»Êý¾Ý 648 $('.J_advisory_submit').bind('click', function(){ 649 650 if (true != detail.chkLoginStatus()) return false;
651 652 var postUrl = jQuery('#advisoryBody').attr('action'); 653 var title = jQuery('.zx_title').val(); 654 var content = jQuery('.zx_content').val(); 655 656 jQuery.cookie('ask_title', '') 657 jQuery.cookie('ask_content', '') 658 659 if (!THISCHECK()) return false; 660 661 jQuery.ajax({ 662 type: "GET",//ʹÓÃget·½·¨·ÃÎʺǫ́ 663 dataType: "jsonp", 664 jsonp: 'callback', 665 url: postUrl, 666 data: "title="+decodeURI(title)+"&content="+decodeURI(content),//Òª·¢Ë͵ÄÊý¾Ý 667 complete :function(){}, 668 success: function(data){//dataΪ·µ»ØµÄÊý¾Ý£¬ÔÚÕâÀï×öÊý¾Ý°ó¶¨ 669 670 if (data.status == 'onlogin') { 671 showLogin(); 672 return false; 673 } else { 674 dialog.closeDialog(); 675 var msg; 676 if (data.status == 'isok') { 677 msg = '<p><span>×ÉѯÌá½»³É¹¦£¡</span></p><p><a class="click_look" href="https://home.99.com.cn/uask.aspx" target="_blank">µã»÷²é¿´ÎÒµÄÌáÎÊ >></a></p>'; 678 } else { 679 var errcode = '×ÉѯÌύʧ°Ü£¡'; 680 var linkcode = '<a class="click_look" href="https://home.99.com.cn/uask.aspx" onclick="dialog.closeDialog();">µã»÷²é¿´ÎÒµÄÌáÎÊ >></a>'; 681 switch(data.resultvalue) { 682 case '-1' : 683 errcode = '×ÉѯÌύʧ°Ü£¬<a href="https://ask.99.com.cn" target="_blank">²é¿´ÎÒÕ˺ÅÊÇ·ñ¼¤»î</a>'; 684 break; 685 case '-2' : 686 errcode = 'Ìύ̫¿ìÁË£¬ÇëһСʱºóÔÙÌá½»°É¡£'; 687 break; 688 } 689 msg = '<p><span class="error">'+ errcode +'</span></p><p>'+ linkcode +'</p>'; 690 } 691 692 dialog.showMsgBox({ 693 w : 380, 694 h : 260, 695 inner : msg, 696 dlgCls : 'prompt', 697 dlgInnerCls : 'prompt_con' 698 }, '1.0'); 699 } 700 } 701 }); 702 }) 703 }); 704} 705 706function charCodeAtlen(s) { 707 var l = 0; 708 var a = s.split(""); 709 for (var i = 0; i < a.length; i++) { 710 if (a[i].charCodeAt(0) < 299) { 711 l++; 712 } else { 713 l += 2; 714 } 715 } 716 return l; 717} 718 719function TRIM(value) { return value.replace(/^\s*/, '').replace(/\s*$/, ''); } 720 721function THISCHECK() { 722 var v, t; 723 t = TRIM($(".zx_title").val()).replace(/\s/ig, ""); 724 if ("" == t || t == "È磺³¦½áºËÔõôԤ·À£¿") { 725 alert("ÌáÎʱêÌâ²»ÄÜΪ¿Õ£¡"); 726 $(".zx_title").focus(); 727 return false; 728 } 729 if (40 < parseInt(charCodeAtlen(t))) { 730 alert("ÌáÎʱêÌâ±ØÐëСÓÚ20¸öºº×Ö»ò40¸ö×Ö·û£¡"); 731 $(".zx_title").focus(); 732 return false; 733 } 734 if (10 > parseInt(charCodeAtlen(t))) { 735 alert("ÌáÎʱêÌâ±ØÐë´óÓÚ5¸öºº×Ö»ò12¸ö×Ö·û£¡"); 736 $(".zx_title").focus(); 737 return false; 738 } 739 v = $(".zx_content").val().replace(/<a[^>]*>/ig, ""); 740 v = v.replace(/<\/a>/ig, ""); 741 if ("" == v) { 742 alert("ÌáÎÊÄÚÈݲ»ÄÜΪ¿Õ£¡"); 743 $(".zx_content").focus(); 744 return false; 745 } 746 if ("" == v.replace("µã»÷ÕâÀïÊäÈëÎÊÌâÄÚÈÝ£¬ÎÊÌâ˵Ã÷Ô½Ïêϸ£¬Ò½Éú»Ø¸´Ò²¾ÍԽ׼ȷ£¡", "").replace("<br/>", "")) { 747 alert("ÌáÎÊÄÚÈݲ»ÄÜΪ¿Õ£¡"); 748 $(".zx_content").focus(); 749 return false; 750 } 751 if (20 > parseInt(charCodeAtlen(v.replace("µã»÷ÕâÀïÊäÈëÎÊÌâÄÚÈÝ£¬ÎÊÌâ˵Ã÷Ô½Ïêϸ£¬Ò½Éú»Ø¸´Ò²¾ÍԽ׼ȷ£¡", "").replace("<br/>", "")))) { 752 alert("ÄúºÃ£¬ÎªÁËÒ½ÉúÄܶÔÄú½øÐÐ×îÏêϸ¡¢×îÌùÐĺÍ×îºÃµÄ°ïÖú£¬ÌáÎÊÄÚÈÝÇë¶àÓÚ10¸öºº×Ö£¬ÇëÄú½øÐв¹³ä¡£"); 753 $(".zx_content").focus(); 754 return false; 755 } 756 return true; 757} 758 759function scroll_Div(obj, def_top){ 760 var clientH = $(window).height(); 761 var offsetTop = def_top + $(window).scrollTop() +"px"; 762 763 $(obj).css('top', offsetTop); 764 $(window).scroll(function (){ 765 var offsetTop = def_top + $(window).scrollTop() +"px"; 766 $(obj).css('top', offsetTop); 767 }); 768 769} 770 771//ÃâÔðÉùÃ÷ 772/*$(function(){ 773 if($('.detail_con img:first').attr('src')!="http://img.99.com.cn/rxys.gif"){ 774 $("<p style='margin-top:10px;font-size:13px;'> ÉùÃ÷£ºÍ¼Æ¬À´Ô´ÍøÂ磬ÈçÓÐÇÖȨ£¬¾´Çë¸æÖª</p>").appendTo($('.detail_con img:first').parent()); 775 } 776})*/ 777//Çø¿éÓÒ²àµÚ¶þÕÅͼ¹ã¸æ 778 779 780function showList(name,value){ 781 if(value==1){ 782 $('#'+name).css('display','block'); 783 }else{ 784 $('#'+name).css('display','none'); 785 } 786} 787//Í·ÌõÕ¾³¤Ö÷¶¯ÊÕ¼ 788(function(){ 789var el = document.createElement("script"); 790el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?fac5a0e1d0312d3ee19b188d1b07be05f5b74c6b63cc8c01e9ff6284c564f2da3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a"; 791el.id = "ttzz"; 792var s = document.getElementsByTagName("script")[0]; 793s.parentNode.insertBefore(el, s); 794})(window)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.