• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in implementting Ajax on Safari2

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Safari 2 is not able to handle the Ajax call. Can any one please suggest me to handle the case.

Thanks
Kushagra
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "the AJAX call"? Show us the code you're using.

Also, you might want to read Dynamic HTML and XML: The XMLHttpRequest Object if you haven't done so already.
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have implement AJAX on my jsp page and I am refreshing the my page on the basis of particular requirement.

Its working fine for Window but in Mac for Safari version 2.0.4 its not wqorking fine.
its Server status is returning"undefined"(200 for of condition).

but the readstatus is showing 4 which is ok.

Now what should I do.

Thanks
Kushagra
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

its Server status is returning"undefined"(200 for of condition).


Are you saying that the response is complete, the server response code is 200, but that the text returned form the server is not what you expected? If so, it's a server problem; make sure it serves what you expect it to serve.

If you mean something else, please be more elaborate: TellTheDetails. As I said, seeing the JavaScript code would help diagnose this.
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Actually on the server itself call not reached.

Thats why I think problem is coming.

Thanks
Kushagra
 
Sheriff
Posts: 67746
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
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.

 
Bear Bibeault
Sheriff
Posts: 67746
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
You'll need to show us your code. I've been making Ajax calls on Safari for years with no issues.

Be sure to use code tags when posting code.
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator








Here the url I am using is the relative URL. On searching the internet some one says that Safari will not work for relative URL. But at the same time I have applied it for absolute URL but still giving the same error.

Please suggest me the solution and problem in this code.

Thanks
Kushagra
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For starters, put in proper error handling. This is not a good idea:


catch(e)
{}


How will you know if there is a problem?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear and I always recommend that you use a JavaScript library to make your Ajax calls. Than you do not have to deal with the browser quirks.

But in your case have you seen what the status is?



Eric
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Ya for the first time request status is coming as"undefined" and so it is not going int he if loop might be that will be the problem.

But there is one more problem. Actually in my code I have to check for session for every 1sec and due to this reason in the else I put a call for the setTimeOut("function{calc();}",1000) function of the javascript. And for that reason I want to show you one more code that I implemented mean while.



This is the code that I implements after the past discussion in the forum.
In that code its working fine for IE and firefox on window but for Mac Safari its not working at all.

If in req.open("GET", url, false) I put here false instead of true so it became sync call and in that case first time it goes in the showStatus() function but as it will get false it will never come again in the showStatus() function.


Please suggest me the possible solution for the same.

Thanks
Kushagra
 
Bear Bibeault
Sheriff
Posts: 67746
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

Actually in my code I have to check for session for every 1sec


EVery second? Why? What possible use could this be?
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually this is the requirement of my project as I am using JWS and swing so it will not possible from Swing end to refresh the page. And I have to refresh the page so due to that reason I use Ajax on Page which will check the session value which will check for a flag which I am updating as soon as functioning of Swings over and when it finds any changes in flag as'true' it will goes in the showStatus() function and goes in the if loop and submit the page and then refesh the page. Due to that reason I have to check for the session and due tio that I am calling Ajax hit in each and every second.

As I already told that its working fine for Window OS but creating problem for Mac OS.

Please suggest the possible way to tackle the situation.

Thanks
Kushagra
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

This code is working fine for safari 3 and higher version but for version 2 its not working.

Is there a specific reason for the same. Also might be stTimeout() is not calling properly for safari 2 version

Please suggest.

Thanks
Kushagra
 
Kushagra Bindal
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a solution for the same.

Thanks
Kushagra
 
reply
    Bookmark Topic Watch Topic
  • New Topic