this first thing I see is that you are not stopping the link from
reloading the page
try this:
<a href="#" onclick="updateElement();return
false">Update the element
[Works on
FF, Fails on IE7]</a>
instead.
Let me know if it works
Thanks
On Nov 18, 3:14 pm, fredistic
<fredis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Reviewing Ajax with the book ''Ajax on Rails''. At the
bottom of page
> 24 the examples uses Ajax.request from prototype.js to replace text.
> It works in FF2 but fails in IE7. That''s a bug I need to fix.
>
> Here''s the failing code:
> <p>
> <a href="#" onclick="updateElement();">Update
the element [Works on
> FF, Fails on IE7]</a>
> </p>
> <p id="responsive"></p>
> <script type="text/javascript">
> function updateElement() {
> alert("updateElement called");
> new Ajax.Request(''/chapter2/simpleresponse'', {
onSuccess:
> function(request) {
> $(''responsive'').update(request.responseText);
> }})
> }
> </script>
>
> I changed from id="response" to id="responsive"
thinking I had a name
> conflict. No change.
>
> I tried turning off native XMLHTTP support in the options -- no
> change.
>
> Works as specified in Firefox 2.0.0.9, not in IE7.
>
> On IE7, the alert() comes up and says "updateElement called" like
it
> should, but the next line does nothing. Removing the alert() -- no
> change.
>
> Any ideas,
> Fredistic
>
> prototype.js 1.5.0
> rails 1.2.4
> ruby 1.8.6
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---