[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
I am using Firebug, and everything works fine in FF, Safari, Opera, and even IE 8. Something about IE 7 though is throwing that error and I can't for the life of me track what it is. :( On Nov 17, 9:19 am, Michel Belleville michel.bellevi...@gmail.com wrote: Well, when I've got an error saying

[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
I am using Firebug, and everything works fine in FF, Safari, Opera, and even IE 8. Something about IE 7 though is throwing that error and I can't for the life of me track what it is. :( On Nov 17, 9:19 am, Michel Belleville michel.bellevi...@gmail.com wrote: Well, when I've got an error saying

[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
Could it have something to do with the 'data' variable not being available to the function that I have placed inside the $.getJSON call? Is there a way to force it to pass on/be available to my ppButton.click(...) function? This is all I can think of for now.

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michel Belleville
Oh, yeah, now I see. Of course data is probably not what you expect where you're reading it. Why would it ? It's set in a callback as a function's parameter, it's not meant to get out of the callback's scope, and even when it would, you don't know when the callback is triggered, that can be right

[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
So I guess that is the problem then? How would I work towards a solution in making 'data' available to that .click() function? On Nov 17, 10:02 am, Michel Belleville michel.bellevi...@gmail.com wrote: Oh, yeah, now I see. Of course data is probably not what you expect where you're reading it.

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michel Belleville
Well, you can call the click method inside the getJSON callback, that's the most straightforward way to do it, and probably the cleanest. Michel Belleville 2009/11/17 roryreiff roryre...@gmail.com So I guess that is the problem then? How would I work towards a solution in making 'data'

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michael Geary
No, the scope of the data parameter is not the problem. The data parameter is already in scope inside your click handler. (Michel, check the code carefully - don't you agree? The click handler is nested inside the getJSON callback.) If it were broken in IE8 as well as IE7, then I would guess that

[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
Clicking on the first link (i.e. a href=0/a): http://pomona.edu/dev/home/0 string [object Object] [object Object], [object Object], [object Object], [object Object], [object Object] 5 I think the problem is in my var aIndex = $(this).attr('href'); In IE 7 it is appending the full URL...any

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michel Belleville
2009/11/17 Michael Geary m...@mg.to No, the scope of the data parameter is not the problem. The data parameter is already in scope inside your click handler. (Michel, check the code carefully - don't you agree? The click handler is nested inside the getJSON callback.) Apparently. Indenting

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michael Geary
That is odd. jQuery's attr() method goes to some amount of work to try to get the raw content href attribute ('0') instead of the fully qualified URL. But it all boils down to a .getAttribute('href',2) call on the DOM element. An interesting test would be to replace this line: var

[jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread roryreiff
I am using v1.3.2 I replaced var aIndex = $(this).attr('href'); with var aIndex = +this.href.match( /\d+$/ )[0]; and it works now. Thanks for the help!