The Dark Knight
The Dark Knight

Reputation: 5585

Nyro modal peculiar error

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 ?

Upvotes: 0

Views: 87

Answers (1)

Lex Podgorny
Lex Podgorny

Reputation: 2930

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.

Upvotes: 0

Related Questions