Sorry for the slightly off-topic post.
I have a piece of Javascript that I am using to make an Ajax call
using prototype. It works fine in Firefox and IE 7, but is giving a
syntax error in Safari 2.04. Can anyone see what is wrong with this
code?
function makeRequest() {
url = /ajaxtest/index
new Ajax.Request(url, {
method: ''get'',
onSuccess: function success(t) { <------------- Safari gives a
syntax error on this line (Syntax error - parse error)
alert(''success'');
},
onFailure: function failure(t) {
alert(''failed ajax'');
}
} );
}
As far as I can tell this example is identical to the example in the
prototype.js api docs - I just cannot figure out what is wrong!
Thanks,
Stephen.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Sorry for the slightly off-topic post.
I have a piece of Javascript that I am using to make an Ajax call
using prototype. It works fine in Firefox and IE 7, but is giving a
syntax error in Safari 2.04. Can anyone see what is wrong with this
code?
function makeRequest() {
url = /ajaxtest/index
new Ajax.Request(url, {
method: ''get'',
onSuccess: function success(t) { <------------- Safari gives a
syntax error on this line (Syntax error - parse error)
alert(''success'');
},
onFailure: function failure(t) {
alert(''failed ajax'');
}
} );
}
As far as I can tell this example is identical to the example in the
prototype.js api docs - I just cannot figure out what is wrong!
Thanks,
Stephen.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Small correction to the code below - I missed the quotes off the URL string, but the mistake is only in this post, not in my actual code, so the problem still exists. On Oct 10, 9:49 pm, stephen O''D <stephen.odonn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sorry for the slightly off-topic post. > > I have a piece of Javascript that I am using to make an Ajax call > using prototype. It works fine in Firefox and IE 7, but is giving a > syntax error in Safari 2.04. Can anyone see what is wrong with this > code? > > function makeRequest() { > url = ''/ajaxtest/index''; > new Ajax.Request(url, { > method: ''get'', > onSuccess: function success(t) { <------------- Safari gives a > syntax error on this line (Syntax error - parse error) > alert(''success''); > }, > onFailure: function failure(t) { > alert(''failed ajax''); > } > } ); > > } > > As far as I can tell this example is identical to the example in the > prototype.js api docs - I just cannot figure out what is wrong! > > Thanks, > > Stephen.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---