• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

AJAX not working in Safari

 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 6926
1316
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks but that didn't work!
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic