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

Discussion in 'Javascript' started by Graham J, Sep 20, 2003.

  1. Graham J

    Graham J Guest

    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.
     
    Graham J, Sep 20, 2003
    #1
    1. Advertising

  2. "Graham J" <> 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 -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Sep 20, 2003
    #2
    1. Advertising

  3. Graham J

    Graham J Guest

    > > 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.
     
    Graham J, Sep 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo
    Replies:
    0
    Views:
    563
  2. Boris
    Replies:
    6
    Views:
    1,374
    Patricia Shanahan
    Apr 21, 2007
  3. Sloan Thrasher
    Replies:
    1
    Views:
    103
    Berend de Boer
    Aug 14, 2003
  4. Nodlehs
    Replies:
    0
    Views:
    84
    Nodlehs
    Mar 30, 2006
  5. Jason S
    Replies:
    3
    Views:
    115
    Jason S
    Oct 5, 2007
Loading...

Share This Page