View Single Post
Old 10-05-2012, 07:11 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,559
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
document.getElementById().src=""?

But this seems to show a second of the original image before replacing it with the queried new image...
That's the right way, but the question is: Why would you have something OTHER than the first image there in the first place? If it takes a second or two to figure out what you need to display, maybe you should instead show something completely different--a kind of "please wait" placeholder?--until you have all your content ready to display.

document.write is considered obsolete and is clearly not the preferred way to go. Among other things, you can *NOT* use document.write after a page is loaded (after the </body> and </html> tags have been processed by the browser). If you do so, you will WIPE OUT ALL PRIOR CONTENT of the page, including even the JavaScript code you use to do the document.write! So that means you MUST use document.write DURING the creation of the page. And if your filtering et al. takes several seconds to complete, that means that the browser will be showing *nothing* (or at least an incomplete page) until you complete the last processing and the last document.write.

So... Methinks you need to come up with a way to make your page look good for those few seconds it takes to do the processing.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Users who have thanked Old Pedant for this post:
erebus (10-05-2012)