By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,670 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,670 IT Pros & Developers. It's quick & easy.

Can I make browsers display contents of a window triggered by onClick before page finishes loading?

P: n/a
Hello,

Apologies for the somewhat wordy and garbled subject as I couldn't think how
to phrase it and this has hindered my searching for any previous answers.
It could be a really simple question. Anyway...

I have a simple javascript function that opens up a new window and writes
HTML code in it to display an image (I don't just display the image because
of problems with different margins in different browsers). Nothing exotic
there. I call this via 'onClick' on various links. Again nothing unusual
there.

The problem is that if I click on a link before the page is completely
loaded the various browsers I have tried will open the new window and even
write the HTML into it (Opera clearly does), but will wait until all the
images etc on the original page have been completely loaded before
displaying the image in the new window. This is in contrast to what happens
when you click on a normal link as that tends to take priority over the
original page.

Is there anything I can do to make my window jump the queue and be displayed
fully immediately?

G.

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Graham J" <in***************@orangebucket.co.uk> writes:
Is there anything I can do to make my window jump the queue and be displayed
fully immediately?


Probably not.

What happens is what always happens when you open two pages at a time.
The browser only have a certain number of connections open at a time.
Other images that need to be loaded are queued, and will be loaded
when there is a connection available. The original page probably
already queued a bunch of images, so the new page starts out at the
back of the line. There is no way to prioritize the elements.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
> > Is there anything I can do to make my window jump the queue and be
displayed
fully immediately?
Probably not.


That is pretty much what I expected but it was worth a try :)
What happens is what always happens when you open two pages at a time.
The browser only have a certain number of connections open at a time.
Other images that need to be loaded are queued, and will be loaded
when there is a connection available. The original page probably
already queued a bunch of images, so the new page starts out at the
back of the line. There is no way to prioritize the elements.


That is certainly how I see things happening too.

In my original post I suggested that clicking on a normal link seemed to
jump the queue but having just tried it again I realise I didn't have the
whole story. If the link is to an image file then that will be loaded
straight away, jumping the queue as it were, but if it is to an HTML file it
seems any extra downloads required join the back of the queue (using IE, but
I think it is typical behaviour).

Oh well, on to plan B (well more like J actually...).

G.

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.