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

Posted by Ankur on Stack Overflow See other posts from Stack Overflow or by Ankur
Published on 2010-04-20T04:03:54Z Indexed on 2010/04/20 4:13 UTC
Read the original article Hit count: 205

Filed under:
|
|

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
seraliseQuery();
});

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

Everything is within

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

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery