缺失}

18 篇文章 0 订阅
3 篇文章 0 订阅

我的情况是这样的:我们的首页是由动态页面生成的静态页面(index.aspx生成index.html)

但奇怪的是 index.aspx 是没有错误的,但是index.html 总是报

" missing }  位置:getDataByCity("zuixinshangjia", "/Ajax/Product/TagList.ashx?tagid=105&showtype=9"); //更新最新上架"

下面是代码:

<script language="javascript" type="text/javascript"> 
              
      /*异步请求楼层数据等*/ 
      function getDataByCity(conId, strUrl) { 
            $.ajax({ 
                url: strUrl, 
                type: "post", 
                cache: false, 
                success: function (data) { 
                            $("#" + conId).html(""); 
                            $("#" + conId).html("test 当前城市为:" + $("#currCity").html()); 
                } 
            }); 
            return false; 
      } 
      
      $(function () { 
            GetUserInfo(); 
            GetCartNum(); 
            /****最新产品等***/ 
            getDataByCity("rexiaozhuanqu", "/Ajax/Product/TagList.ashx?tagid=105&showtype=9"); //更新热销专区 
            getDataByCity("zuixinshangjia", "/Ajax/Product/TagList.ashx?tagid=105&showtype=9"); //更新最新上架 
            getDataByCity("pinpaijingxuan", "/Ajax/Product/TagList.ashx?tagid=105&showtype=9"); //更新品牌精选 
            getDataByCity("cuxiaozhuanqu", "/Ajax/Product/TagList.ashx?tagid=105&showtype=9"); //更新促销专区 
            getDataByCity("meironghufu", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=3"); //更新美容护肤 
            getDataByCity("shipinyinliao", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=1"); //更新食品饮料 
            getDataByCity("shumajiadian", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=5"); //更新数码家电 
            getDataByCity("muyingyongpin", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=4"); //更新母婴用品 
            getDataByCity("jiajuriza", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=203,206,207,209,211,212,213"); //更新家居日杂 
            getDataByCity("fuzhuangfushi", "/Ajax/Product/TagList.ashx?tagid=105&showtype=4&cid=8"); //更新服装服饰 
        }); 
    </script>

最后才发现时:生成index.html 之后 所有的页面源码全部成了一行 而我有有注释符号“//最新热销专区”  因为代码全部都在一行了 就成了:

getDataCity("","")//更新热销专区........});

所有 });就被注释掉了


确实是缺少了} 


在js 里  写注释最好不要用 //  用/**/  比较好

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值