Image onLoad

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • frizzle

    Image onLoad

    Hi there, ijust a quicky:

    I was wondering if the following is supported everywhere:
    <img src="spacer.gif " width="1" height="1" onLoad="doometh ing()">

    That way i can launch/check a few things before the page has
    comleted loading, which is necesary when one uses <body onLoad="">

    Hope it's clear.

    Thanks!

  • McKirahan

    #2
    Re: Image onLoad

    "frizzle" <phpfrizzle@hot mail.com> wrote in message
    news:1109948928 .539234.238220@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > Hi there, ijust a quicky:
    >
    > I was wondering if the following is supported everywhere:
    > <img src="spacer.gif " width="1" height="1" onLoad="doometh ing()">
    >
    > That way i can launch/check a few things before the page has
    > comleted loading, which is necesary when one uses <body onLoad="">
    >
    > Hope it's clear.
    >
    > Thanks![/color]

    A Google search found this link:



    "The onLoad event is fired when the image is finished being downloaded. "


    Comment

    • frizzle

      #3
      Re: Image onLoad

      Ok, tanks, i guess it's safe to use then..!
      Thanks for the fast reply.

      Comment

      • McKirahan

        #4
        Re: Image onLoad

        "frizzle" <phpfrizzle@hot mail.com> wrote in message
        news:1109950278 .418306.310630@ f14g2000cwb.goo glegroups.com.. .[color=blue]
        > Ok, tanks, i guess it's safe to use then..!
        > Thanks for the fast reply.
        >[/color]

        Perhaps...

        "Unfortunat ely, onLoad is not a very reliable event handler. Netscape
        particularly has trouble firing onLoad when the image is malformed in some
        way or if the image is loaded from cache instead of freshly downloaded from
        the net."

        But loading from cache isn't an issue for you, I gather.


        Comment

        • frizzle

          #5
          Re: Image onLoad

          No, but thanks for your concern:
          I found a nice flash check which i'm using for a site.
          It was actually using document.write if flash was enabled.
          I tweaked it a little bit, and now it redirects people to a non-flash
          landing page, so there is no problem loading it from cache..

          Thanks anyway! :)

          Have yourself a fine weekend.

          Comment

          • Jim Ley

            #6
            Re: Image onLoad

            On 4 Mar 2005 07:08:48 -0800, "frizzle" <phpfrizzle@hot mail.com>
            wrote:
            [color=blue]
            >Hi there, ijust a quicky:
            >
            >I was wondering if the following is supported everywhere:
            ><img src="spacer.gif " width="1" height="1" onLoad="doometh ing()">
            >
            >That way i can launch/check a few things before the page has
            >comleted loading, which is necesary when one uses <body onLoad="">[/color]

            What do you want to actually do, if you want to do something after
            elements are fully parsed, but before the content is loaded, you can
            almost reasonably reliably do it simply by including inline script
            after the part you want. You'll want to take normal care that they
            are available, but they almost certainly will be.

            No need to mess around with unreliable image load methods.

            Jim.

            Comment

            Working...