468,245 Members | 1,668 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,245 developers. It's quick & easy.

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

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
2 1640
"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
> > 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.

Similar topics

1 post views Thread by amith | last post: by
7 posts views Thread by Dr J R Stockton | last post: by
3 posts views Thread by =?Utf-8?B?R3JlZyBN?= | last post: by
20 posts views Thread by Mark Anderson | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.