Question

I am using nyromodal . When i try to open , the modal using the code below :

<a id = "idDef" href="#" onclick="callNyroModal();" >What's idDef ?</a>

function callNyroModal()
{
    alert("Inside Nyro function");
    jQuery("#idDef").nm();
}

I see the alert coming up, when i click this link. But then i get this error in firebug :

TypeError: this.on is not a function and the modal does not come up. I am also using jquery(1.4.2/jquery.min.js) here .

Can some one tell me , how can i get rid of this error and let the modal window come up ?

Was it helpful?

Solution

I recommend this:

  1. Figure out what line is causing error
  2. Set a breakpoint in firebug in that line, run code again.
  3. Once execution line is on breakpoint, figure out what "this" is bound to in that context and why it is not jQuery object (I am assuming it should be because this.on is being called). Something must be bind'ing "this" incorrectly. Look for things like bind(), apply(), etc.

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top