File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Problem in simulating progress bar using Ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem in simulating progress bar using Ajax" Watch "Problem in simulating progress bar using Ajax" New topic

Problem in simulating progress bar using Ajax

omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
Hello friends ,

I was just trying out an AJAX based program, in which i simulate progress using a method similar to polling. It works fine, in Firefox or Google Chrome browser, but IE 7 gives "Stack overflow at line:0" alert message after first request is made.

Things i am using :-
jdk 1.6
Tomcat 5.5
IE 7
Firefox 3.0.4
Windows Vista
Eclipse 3.1

and this is what i briefly do:-

1) i make the first request to server through ajax by clicking a button.
2) on Server when request is received ... server increments a counter and sends back that value to client
3) before sending back the counter i make the thread to sleep for few seconds in my that i can simulate or get the feel of delay as we see in progress bar
4) i get the counter value in response xml
5) according to the counter i calculate a value and paint a div present in the page with its width set to the calulated value
6) then again the javascript sends another request
7) the cycle continues....until the entire Div gets painted

The servlet code :-


and the servlet mapping in web.xml is :-


and the .... html file is :-



PLEASE HELP ME! ... what is wrong in the it is not working in IE 7 ? Million thanks in advance

Thanks and Regards
Omkar Patkar (SCJP 1.4)[url][/url] | [url][/url]
omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
Please can some one help me out ???
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
PatienceIsAVirtue. It's the weekend; do you really expect answers within 86 minutes?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Have you debugged what is the world is happening?
Is the request making to the server? Is it cached?

omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
Hello Friends,

I am sorry i was a bit impatient. The problem is fixed now! ... i don't know how ...but here is the story.

While i was waiting for some solution on ranch ...i went through following links which talk about "Stack overflow" problem of internet explorer.

... so i played with the settings or configuration of IE... i did not find any option like "Disable third party plugins" ... But i did find, options like:-
"Disable script debugging(Internet Explorer)" [...this was already ticked]
"Disable script debugging(Other)" [... this option was also ticked]
"Display notification for every script error [... and even this option was ticked]

so i unticked the 1st 2 options. In the meantime while i was searching the internet for some possible, i was also modifying the Ajax code, and considerable changes had been made by then.

TO MY SURPRISE.... the code worked !!! in all the three browsers :-
IE 7
Firefox 3.0.4
Google Chrome

.... i reverted back the settings of the browser to default and tried undoing the changes i made to the code as far as possible to reproduce the problem .....but to my surprise the error is not reproducible and still it is working in all the three browsers.

i really don't know what was the ACTUAL problem...and how it got solved.

Shall i post the latest AJAX code ... can someone please guide, what could have possibly went wrong ?

Million thanks!
I agree. Here's the link:
subject: Problem in simulating progress bar using Ajax
It's not a secret anymore!