Authored by wangqing

限制请求数据

@@ -720,27 +720,33 @@ function actionNav() { @@ -720,27 +720,33 @@ function actionNav() {
720 }); 720 });
721 } 721 }
722 722
  723 +
723 function actionTipPic() { 724 function actionTipPic() {
724 - var $content_code = '' 725 + var tipscode = {};
  726 + var $contentcode = '';
725 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code='; 727 var serverApi = 'http://www.yohobuy.com/common/getbanner?content_code=';
726 var $img = ''; 728 var $img = '';
727 var $title = ''; 729 var $title = '';
728 var $link = ''; 730 var $link = '';
729 731
730 - $(document).on('mouseenter','.sub-nav-item',function(){  
731 - $content_code = $(this).find('.showdetail').attr('data-code');  
732 - if($content_code){ 732 + $(document).on('mouseenter', '.sub-nav-item', function() {
  733 + $contentcode = $(this).find('.showdetail').attr('data-code');
  734 + if ($contentcode) {
  735 + if(!tipscode[$contentcode]){
  736 + tipscode[$contentcode] = $contentcode;
733 $img = $(this).find('.showdetail').find('img'); 737 $img = $(this).find('.showdetail').find('img');
734 $title = $(this).find('.showdetail').find('.title'); 738 $title = $(this).find('.showdetail').find('.title');
735 $link = $(this).find('.showdetail').find('a'); 739 $link = $(this).find('.showdetail').find('a');
736 - $.get(serverApi + $content_code+'&width=337&height=250&client_type=web', function(rsdata) {  
737 - $img.attr('src',rsdata.data.src);  
738 - $link.attr('href',rsdata.data.url); 740 + $.get(serverApi + $contentcode + '&width=337&height=250&client_type=web', function(rsdata) {
  741 + $img.attr('src', rsdata.data.src);
  742 + $link.attr('href', rsdata.data.url);
739 $title.text(rsdata.data.title); 743 $title.text(rsdata.data.title);
740 }, 'jsonp'); 744 }, 'jsonp');
741 } 745 }
742 746
743 - }) 747 + }
  748 +
  749 + });
744 750
745 } 751 }
746 752
@@ -1348,7 +1354,7 @@ function actionLoginInfo() { @@ -1348,7 +1354,7 @@ function actionLoginInfo() {
1348 */ 1354 */
1349 function init() { 1355 function init() {
1350 actionNav(); //处理导航 1356 actionNav(); //处理导航
1351 - actionTipPic();//鼠标移入后查询 1357 + actionTipPic(); //鼠标移入后查询
1352 actionExeTemplate(); //处理模板 1358 actionExeTemplate(); //处理模板
1353 actionInitCookie(); //初始化cookie 1359 actionInitCookie(); //初始化cookie
1354 actionExeCookieMap(); //格式化cookie 1360 actionExeCookieMap(); //格式化cookie