This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a mozilla specific problem , after an js alert data not getting printed at client side.

 
tejas bhojak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a specific problem in mozilla

i have written a JSP page
and there i have an inline script where i print an alert
like:-

test.jsp


now i try to open this jsp page
i get the alert
but the data after the alert is not getting printed
there is no error on my server console
and there are no error on mozilla error console
and this issue is in Mozilla only, in IE it's fine!

can any one please explain me
(1) how javascript code are executed at client side when page is still not completely loaded.
(2)I have made an observation, while fetching data from database and printing it through a JSP.
I tried printing more than thousand rows from DB to the browser(the client side).
now when the content was getting printed at client side it was not in one go
i could actually see the data getting printed slowly on browser, and while data was getting printed at client side
the query on the server side was not completely executed it was still fetching data from database.
so i believe that servlet engine doest not wait for the java code to get completely executed, it will render the page as an when
it gets the data, so if web server takes time to fetch the data that delay will be reflected at client side,
and between all these delays we have and javascript alert!
so i am not able to visualise , what will happen if there is an alert , will web server stop fetching data till ok on alert is press
or server will fetch the data but wont print it until we press okay key!

please help, i am really confused about this javascript execution before the page is completely rendered at client side.
thanks in advance.

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a page like this



This works fine for me. Also this forum is for JSP, please use the HTML-JavaScript forum for such questions...
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not possible. Java code runs on server, javascript functions on client.
 
tejas bhojak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit you are rite
but in your case there is no rendering of page from an web server to client
what you are doing its on client side only.

in my case the data is getting rendered from web server(Jboss) to client(Mozilla).
and even if you code it in JSP that will work because its really fast for web server to generate static HTML.

i have a doubt , that what will happen if the page to be rendered on client is not completely ready,
and by observation i see that web server keeps on rendering the page as an when the static HTML is generated.

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what will happen if there is an alert , will web server stop fetching data


As Eduardo said, the alert has nothing to do with the server side processing. Only the browser is concerned with that. The browser might not render anything unless you press ok but the server will keep sending the output...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.
 
tejas bhojak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible that web server has rendered the data to browser but because of some condition
or may be some bug in browser, its not printing the data.
This may be a rare scenario,
but is it possible?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does a View Source form the browser show you?
 
tejas bhojak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats interesting , it does show me the HTML content.
view source is not blank!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why was that not your first debugging step?

Is all of it there?

If the HTML is complete, and part of it is not being displayed, a good bet is that the HTML is invalid.
 
tejas bhojak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've got one bug reported for mozilla.
webpage

I don't have any issue with the bug , if i delay the alert for some time
or if i change the location of alert to last page then the page is displayed properly
so i do have a work around.
but how all these things are happening , i am not able to digest .
Why mozilla wont print the page which is already fetched from web server?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic