开发者

Why can't I call this function (javascript/jquery)

开发者 https://www.devze.com 2022-12-27 05:52 出处:网络
This is driving me nuts .... I have written a function function seraliseQuery(){ for(var i=1; i<=variables;i++){

This is driving me nuts ....

I have written a function

function seraliseQuery(){
for(var i=1; i<=variables;i++){
    alert(queryPreds[i]+" - "+queryObjs[i]);
  }
}

I just want to be able to call it from my other function

$(".object").click( function() {
    // code removed
serali开发者_StackOverflowseQuery();
});

The error I get is "the function serialiseQuery() is undefined".

Everything is within

$(document).ready( function() { 
   // code goes here
}


You just spelled it wrong. Rename the function "serialiseQuery".

0

精彩评论

暂无评论...
验证码 换一张
取 消