Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronous javascript possible?

Status
Not open for further replies.

jsteph

Technical User
Joined
Oct 24, 2002
Messages
2,562
Location
US
I have an asp page, on which I have a button. The onclick calls a js function that reads some screen data, then sets the .location an iframe to another asp page. This other asp page has code which updates a sql server database.

Since the main page isn't being reloaded, I want to show a status immediately after the iframe's new .location code runs. What seems to be happening is that the javascript code is asynchronous, so that after the call setting the new iframe.location, my call to check the output (the iframe source writes a new textbox in the iframe with status info in it), returns nothing.

How do I (without randomly timed delay loops) wait for the iframe to finish it's update, write the status to the textbox on the iframe and then read it--all within the same javascript function, ie not having to have the user hit another button to see the results?

I understand that when the script started, the lay of the land was one way, and it changed while the script was running. But I need to know how I can 'refresh' the objects javascript sees on the page without exiting the code.
Thanks,
--Jim
 
you might want to throw this thread in the JS forum.

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top