为了账号安全,请及时绑定邮箱和手机立即绑定

引用外部JS时没有反应,提示Uncaught SyntaxError: missing ) after argument list

引用外部JS时没有反应,提示Uncaught SyntaxError: missing ) after argument list

小小sky 2017-02-04 14:49:26
这段代码在内部文件种可以使用(加载的效果功能什么都可以),但是放到外部文件里就没反应了代码如下:            <script src="../assets/global/scripts/jqnav.js" type="text/javascript"></script>            $(function(){               alert("已经调用到");                $("#region_statistics_content").css("height",$("#remap").css("height"));                $(window).resize(function(){                    $("#region_statistics_content").css("height",$("#remap").css("height"));                });                $(".message_close").click(function(){                    $(".city_message").hide();                });                $(".city a").click(function(){                    $(".city_message").show();                })                  $.post('<?=site_url('Agentmap/province_agent_status')?>',function(data){                    var dataobj = eval("("+data+")");                    console.log(dataobj);                    if(dataobj.none.length){                        for(var i=0;i<dataobj.none.length;i++){                                。。。。                       }        if (dataobj.yet.length) {            for(var i=0;i<dataobj.yet.length;i++){            console.log(dataobj.yet[i].region_name);                    switch(dataobj.yet[i].region_name){            case "安徽":            $(".anhui").css("background-image","url(../assets/global/img/images/anhui3.png)");break;            case "内蒙古":            $(".neimeng").css("background-image","url(../assets/global/img/images/neimeng3.png)");break;            case "黑龙江":            $(".heilongjiang").css("background-image","url(../assets/global/img/images/heilongjiang3.png)");break;            case "新疆":            $(".xinjiang").css("background-image","url(../assets/global/img/images/xinjiang3.png)");break;            case "西藏":            $(".xizang").css("background-image","url(../assets/global/img/images/xizang3.png)");break;            case "青海":            $(".qinghai").css("background-image","url(../assets/global/img/images/qinghai3.png)");break;            case "甘肃":            $(".gansu").css("background-image","url(../assets/global/img/images/gansu3.png)");break;            case "宁夏":            $(".ningxia").css("background-image","url(../assets/global/img/images/ningxia3.png)");break;            case "上海":            $(".shanghai").css("background-image","url(../assets/global/img/images/shanghai3.png)");break;            case "辽宁":            $(".liaoning").css("background-image","url(../assets/global/img/images/liaoning3.png)");break;            case "广东":            $(".guangdong").css("background-image","url(../assets/global/img/images/guangdong3.png)");break;            case "广西":            $(".guangxi").css("background-image","url(../assets/global/img/images/guangxi3.png)");break;            case "河南":            $(".henan").css("background-image","url(../assets/global/img/images/henan3.png)");break;            case "陕西":            $(".shanxi").css("background-image","url(../assets/global/img/images/shanxi3.png)");break;            case "山西":            $(".shanxi1").css("background-image","url(../assets/global/img/images/shanxi2_3.png)");break;            case "河北":            $(".hebei").css("background-image","url(../assets/global/img/images/hebei3.png)");break;            case "吉林":            $(".jilin").css("background-image","url(../assets/global/img/images/jilin3.png)");break;            case "北京":            $(".beijing").css("background-image","url(../assets/global/img/images/beijing3.png)");break;            case "天津":            $(".tianjin").css("background-image","url(../assets/global/img/images/tianjin3.png)");break;            case "山东":            $(".shandong").css("background-image","url(../assets/global/img/images/shandong3.png)");break;            case "江苏":            $(".jiangsu").css("background-image","url(../assets/global/img/images/jiangsu3.png)");break;            case "海南":            $(".hainan").css("background-image","url(../assets/global/img/images/hainan3.png)");break;            case "湖北":            $(".hubei").css("background-image","url(../assets/global/img/images/hubei3.png)");break;            case "云南":            $(".yunnan").css("background-image","url(../assets/global/img/images/yunnan3.png)");break;            case "四川":            $(".sichuan").css("background-image","url(../assets/global/img/images/sichuan3.png)");break;            case "贵州":            $(".guizhou").css("background-image","url(../assets/global/img/images/guizhou3.png)");break;            case "台湾":            $(".taiwan").css("background-image","url(../assets/global/img/images/taiwan3.png)");break;            case "福建":            $(".fujian").css("background-image","url(../assets/global/img/images/fujian3.png)");break;            case "湖南":            $(".hunan").css("background-image","url(../assets/global/img/images/hunan3.png)");break;            case "浙江":            $(".zhejiang").css("background-image","url(../assets/global/img/images/zhejiang3.png)");break;            case "江西":            $(".jiangxi").css("background-image","url(../assets/global/img/images/jiangxi3.png)");break;            case "重庆":            $(".chongqing").css("background-image","url(../assets/global/img/images/chongqing3.png)");break;                }        }    }                })            })
查看完整描述

2 回答

?
风之流动

TA贡献4条经验 获得超1个赞

第一行不能写在内部啊
查看完整回答
反对 回复 2017-02-04
?
风之流动

TA贡献4条经验 获得超1个赞

你是不是引用路径写错了啊
查看完整回答
反对 回复 2017-02-04
  • 2 回答
  • 0 关注
  • 1705 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信