Hey Spanky,
Spanky a écrit :>
> function sendData (frm) {
> var url = ''/includes/ajax/test.asp'';
> var pars = Form.serialize(frm);
> pars = pars + ''&time='' + new Date().getTime();
Just in case, you may want to encode the time value, as a general
principle (even if it *is*, this time, only valid URI chars), with
encodeURIComponent.
> var myAjax = new Ajax.Request( url, {method: ''post'',
parameters: pars,
> onLoading: '''', onComplete: showResponse} );
WTH is this « onLoading: '''' » thing? What are you trying to
do?
> function showResponse (originalRequest) {
> var newData = originalRequest.responseText;
> $(''responseholder'').innerHTML = newData;
The issue may well lie here. Browsers have varying implementations of
innerHTML. Try instead:
$(''responseholder'').update(newData);
> <button type="button"
onClick="sendData(this.form)"
> class="doAction">Add Comment</button>
OK, I''ll refrain from ranting on UJS, this time :-) However, did you
check whether "this.form" worked on IE? You might want to change your
button to submit (if only for accessibility purposes), and use the
form''s onsubmit attribute with "sendData(this)".
Of course, your sendData function would then need to prevent event
propagation, which means you''d need the event object, which is easier
to
do using Prototype''s Event.observe function, thereby going UJS...
> Looping through Request.Form in the asp page shows all the name/value
> pairs when using Firefox. With IE, nothing is displayed (in fact
> Request.Form has a length of 0 in IE).
Since your target page sees no arguments, I suspect "this.form" yields
null somehow, and therefore Form.serialize yields the empty string.
''HTH
--
Christophe Porteneuve aka TDD
tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---