I am having a problem in Firefox. It works fine in IE. I am trying
to update a div using the Ajax.Updater. The problem is that I have a
hidden field called ascOrDesc. This field is set to "Asc" when it is
first loaded. Then I have a sort link that calls the code below. The
first time I click the link it sends "Asc" to the server the value is
then toggled to "Desc". When the page is sent back I can inspect it
with FireBug to confirm the field was changed to "Desc". I also used
a hidden field called ajaxTimeStamp to prevent browser cache of the
request. However, the next time I click the link the alert shows the
old value for the ascOrDesc field and the new value for the
timestamp. Again this only happens in Firefox not IE. Below is a
brief sequence of the problem.
Does anyone have an idea what could be causing this symptom in Firefox
and how to fix it.
Thanks, Rich
----- SEQUENCE -----
- click
- First alert:
ascOrDesc=Asc&sortAttribute=lastName&ajaxTimeStamp=1194639270531
- server toggles value to "Desc"
- the hidden field in the div is updated to "Desc"
- click
- Second alert:
ascOrDesc=Asc&sortAttribute=lastName&ajaxTimeStamp=1194639655843
----- CODE SAMPLE -----
function ajaxSortOn(url,divId,form,attribute) {
form.sortAttribute.value = attribute;
form.ajaxTimeStamp.value = new Date().getTime();
alert($(form).serialize());
updateInnerHtml(url, $(form).serialize(), divId);
}
function updateInnerHtml(url, params, updateId) {
new Ajax.Updater(updateId, url, {
asynchronous: true,
method: "get",
parameters: params,
onFailure: function(request) {
alert(request.responseText);
}
});
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---