# Strange prototype problem

**URL:** <https://www.ruby-forum.com/t/strange-prototype-problem/196485>\
**Category:** Rails\
**Created:** [October 10, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/strange-prototype-problem/196485 "2007-10-10T22:52:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephen\_OSD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@stephen\_OSD](https://www.ruby-forum.com/u/stephen_OSD)\
**Post date:** [October 10, 2007, 10:52pm UTC](https://www.ruby-forum.com/t/strange-prototype-problem/196485/1 "2007-10-10T22:52:00Z")

</div>

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.
