It's not a secret anymore!*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Author

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 bar...by 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 servlet....so 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 code...as it is not working in IE 7 ? Million thanks in advance


Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]
omkar patkar
Ranch Hand

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

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


Ping & DNS - my free Android networking tools app
Eric Pascarello
author
Rancher

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




Eric
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.

http://www.eggheadcafe.com/software/aspnet/29732115/ie7-stack-overflow.aspx

http://answers.yahoo.com/question/index?qid=20070702025645AAs7P7Z

http://www.webdeveloper.com/forum/archive/index.php/t-33308.html

http://bytes.com/groups/javascript/622869-stack-overflow-ie-not-mozilla

... 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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in simulating progress bar using Ajax
 
Similar Threads
How does upload multiple files work
Can't call Servlet using Ajax
Session in HTTPServlet
Can you find the bug in <div> I do NOT get sample xml data[bookrss.xml]... RSS Client/Server
Java Script in AJAX response