Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AJAX not working in Safari

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have got this simple script to work in
IE7
IE6
Firefox pc
Firefox mac
Opera PC
Chrome PC

but not in safari. It's driving me mad. Any pointers?



The onreadystatechange is not getting called in safari.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4682
333
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to instantiate the xml http object with "Msxml2.XMLHTTP" ActiveX object.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks but that didn't work!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course not. That's for IE.

Is the sever-side resource getting called? What other debugging steps have you taken?

And why aren't you using jQuery or Prototype or any of the other useful libraries to do Ajax for you? They take care of any browser differences.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, when using a plain servlet with the code I can get it to work in safari.

I have tried to set up this with wicket framework and it seams that safari can not find the resource but all other browsers can. So now I'm building a servlet
for upload instead. Need progressbar
 
Cloudgen C.F. Wong
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've try the code you've posted. It works Okay with all the browsers. The problem seems to be some "Javascript" outside your code may go wrong. It may not due to the assignment of "url" to variable "u" without declaring "u" as local variable. But it may course problem if you use the variable "u" somewhere outside the block.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a problem for safari and opera as well.

What I really trying to do is to make and multipart upload. and when the upload is started on the onsubmit I'm checking a ajax request. This is not the same way as posting with ajax because this will not work.
However, it seams that the responsiveness of the browsers stops. (in safari, opera. Not in IE ) So the only way is using an Iframe to get it to work with all browsers

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic