我有一个奇怪的错误,我将这些文件包含在我的部分中
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/barScriptOOP.js"></script>
在 barScriptOOP.js 我有这个
function position_bar(){
//global variable
this.sizes = Array();
}
//class methods => getData (from xml file), draw(draws the bar )
position_bar.prototype ={
getData: function(is_load){
var xmlData = Array();
$.ajax({
type: "GET",
url: "Bar.xml",
dataType: "xml",
context: this,
success: function(xml) {
//extracting new data - some code here
xmldata = "blabla";
this.draw(is_load, xmlData);
}
})//end ajax
},
//other functions
当我使用此脚本时,我收到“$.ajax 不是函数”错误。1. 我试着编辑出来this.draw(is_load, xmlData);
,它没有出错。我的程序 rpeatly 调用 getData 函数。
注意:我还收到'$.browser is undefined'
另一个函数中的错误(这是我收到的第一个错误)。
意思==> 去另一个函数无法jquery。
知道这里发生了什么吗?