运行错误的javascript文件

时间:2016-09-08 12:39:11

标签: javascript jquery jsp

在我的一个jsp文件中,我在头部

中调用了“basicEn.js”
<head>
<meta charset="UTF-8">
<meta name=viewport
    content="width=device-width, initial-scale=1, maximum-scale=1">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="index.css">
<script src="javascript/jquery-3.1.0.min.js"></script>
<script src="javascript/basicEn.js"></script>
<title>Insert title here</title>
</head>

然而,当我从萤火虫检查时,“basic.js”正在运行。可能,我错过了一件小事,但我真的被卡住了。

firebug seems like that

// basicEn.jsp

$(document).ready(function() {
    // Your event
    $('li').click(function() {
        var id = $(this).attr('id');
        $.ajax({
            url:'GetPhone',
            data:{id : id},
            dataType:"text",
            type:'get',
            cache:false,
            success:function(data){
                //alert(data); 
                var successUrl = "SelectedFeature-en.jsp"; 
                window.location.href = successUrl;
            },
            error:function(){
                alert('error');
            }
        }
        );
    });
});

0 个答案:

没有答案