Michael Geary wrote:
>>> I see the word GO along with PREV/SAVE/NEXT, but none of them are 
>>> buttons, just plain text.
> 
>> Right, they are aren't buttons yet, but they all have click 
>> events on them so you can just click the text. I plan to 
>> change them to buttons, I'm not sure why I did do that in the 
>> first place. In fact the whole control, is a pseudo-form, 
>> just text in cells. If I change it to a form I can probably 
>> use the form plugin and simplify my code somewhat.
>>
>> If you start with http://imaptools.com/sm/index-003.html it 
>> actually works more or less so you can see how it should 
>> interact. index-002.html was my 1st iteration on 
>> restructuring and clean it up, but I ran into this weird problem.
> 
> Nothing seems to happen when I click the GO text on that page in Firefox 2.

Ok did you try:

http://imaptools.com/sm/index-003.html

it should work in FF2, this is what I'm using. The problem with

http://imaptools.com/sm/index-002.html

is that it does not work. When the page loads in the $(document).ready() 
function the follow block of code runs:

             $(".button").each( function() {
                 var mydata = {
                     check_dirty: 1,
                     action: $(this).text().toLowerCase()
                 };
                 if (mydata.action == 'save') mydata.check_dirty = 0;

                 $(this).css("text-align", "center");
                 $(this).bind( "click", mydata, check_save);
             });

I run the same block of code in index-003.html except I use an anonymous 
function instead of the named function "check_save" to on the 
bind("click", ... line.

$(".button").each() locates all the "buttons" and adds a click envent to 
them, but in index-002.html all the mydata references point to the 
mydata used for the last iteration of each() ie: the "NEXT" button.

What I expected to happen is that each() call to function() would create 
a new instance of mydata so that each bind on a button would have its 
own unique reference to a separate mydata. This is in fact how it works 
using the anonymous function instead of the named function.

-Steve

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to