我在使用jQuery和Mozzila Firefox时遇到了麻烦.一切都在Chrome中运行得很好,但不知何故Firefox没有看到jQuery.
这就是我调用jQuery的方式
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script type="text/javascript" src="assets/bootstrap/js/datepicker.js"></script>
Run Code Online (Sandbox Code Playgroud)
这是它失败的地方(错误是:ReferenceError:$未定义):
<script>
function ajax_check(){
var id = $("#xml_select").val(); // this is the line where I get error
$.ajax({
url: "ajax_check.php?id="+id,
success: function(response) {
var result = jQuery.parseJSON(response);
//console.log( JSON.stringify(result['ncp'].replace('"','')) );
var ncp = JSON.stringify(result['ncp']);
var id = JSON.stringify(result['id']);
$("#racun").val(ncp.substring(1,12));
$("#id_podnosilac").val(id.substring(1,5));
},
});
}
</script>
Run Code Online (Sandbox Code Playgroud)
请帮忙,这可能是什么原因造成的?