SearchSearch   

making it so a particular image is the first thing loaded

 
   Webmaster Forums (Home) -> HTML RSS
Next:  Printing from IE help - preventing page cutoffs  
Author Message
yawnmoth

External


Since: Aug 10, 2007
Posts: 15



(Msg. 1) Posted: Fri Aug 10, 2007 3:47 am
Post subject: making it so a particular image is the first thing loaded
Archived from groups: comp>infosystems>www>authoring>html (more info?)

A webpage can include any number of images, cascading stylesheets,
frame's, etc. How might I go about making it so a particular image
loads before any of these others? Ideally, the image would load even
before the rest of the page loaded.

Any ideas as to how this might be done?

(I'm asking because I'm using a 1x1 image to simulate a cron job)
Back to top
Scott Bryce

External


Since: Apr 12, 2004
Posts: 52



(Msg. 2) Posted: Fri Aug 10, 2007 3:47 am
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

yawnmoth wrote:
> A webpage can include any number of images, cascading stylesheets,
> frame's, etc. How might I go about making it so a particular image
> loads before any of these others?

I don't think that can be done.

> (I'm asking because I'm using a 1x1 image to simulate a cron job)

There is probably a better way to do what you want to do, but it
probably would involve a non-html solution. What are you ultimately
trying to accomplish?
Back to top
Darin McGrew

External


Since: Mar 25, 2004
Posts: 410



(Msg. 3) Posted: Fri Aug 10, 2007 6:08 am
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

yawnmoth <terra1024.DeleteThis@yahoo.com> wrote:
> A webpage can include any number of images, cascading stylesheets,
> frame's, etc. How might I go about making it so a particular image
> loads before any of these others?

You can't.

You can't even guarantee that the particular image will be loaded at all.
--
Darin McGrew, mcgrew.DeleteThis@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin.DeleteThis@htmlhelp.com, http://www.HTMLHelp.com/

"I can take one day at a time, but sometimes several days attack me at once."
Back to top
Helpful person

External


Since: Aug 10, 2007
Posts: 12



(Msg. 4) Posted: Fri Aug 10, 2007 9:13 am
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

On Aug 9, 11:47 pm, yawnmoth <terra1....DeleteThis@yahoo.com> wrote:
> A webpage can include any number of images, cascading stylesheets,
> frame's, etc. How might I go about making it so a particular image
> loads before any of these others? Ideally, the image would load even
> before the rest of the page loaded.
>
> Any ideas as to how this might be done?
>
> (I'm asking because I'm using a 1x1 image to simulate a cron job)

You can use the onload element

http://www.w3schools.com/appml/el_onload.asp

www.richardfisher.com
Back to top
yawnmoth

External


Since: Aug 10, 2007
Posts: 15



(Msg. 5) Posted: Fri Aug 10, 2007 12:40 pm
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

On Aug 9, 11:30 pm, Scott Bryce <sbr....DeleteThis@scottbryce.com> wrote:
> yawnmothwrote:
> > A webpage can include any number of images, cascading stylesheets,
> > frame's, etc. How might I go about making it so a particular image
> > loads before any of these others?
>
> I don't think that can be done.
>
> > (I'm asking because I'm using a 1x1 image to simulate a cron job)
>
> There is probably a better way to do what you want to do, but it
> probably would involve a non-html solution. What are you ultimately
> trying to accomplish?

Basically, what I just said. I'd like to make a modification for an
open source package that'd let admins run whatever PHP script they
wanted to at designated time intervals. If you only got one visitor
every two hours, and you wanted your script to run every hour, that'd
be a problem, but I don't think there's much I can do about that.

I can't rely on cron because the admin might have safe mode enabled,
might not be running on Linux, etc.

At the same time, though, it wouldn't be all that spectacular if the
script was always the last thing to load on the page. If it were,
then people could just click another link and load another page before
the image on the first page had a chance to load.
Back to top
Jukka K. Korpela

External


Since: Feb 13, 2004
Posts: 3794



(Msg. 6) Posted: Fri Aug 10, 2007 7:54 pm
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

Scripsit Helpful person:

> You can use the onload element

You didn't really understand the question, did yoy?

> http://www.w3schools.com/appml/el_onload.asp

Citing w3schools as a reference is always a useful signal of bogosity -
especially in a group where the unreliability of w3schools has often been
mentioned.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Back to top
Jukka K. Korpela

External


Since: Feb 13, 2004
Posts: 3794



(Msg. 7) Posted: Fri Aug 10, 2007 7:58 pm
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

Scripsit yawnmoth:

> What are you ultimately trying to accomplish?
>
> Basically, what I just said. I'd like to make a modification for an
> open source package that'd let admins run whatever PHP script they
> wanted to at designated time intervals.

How is this related to HTML authoring? And how would loading an image do
that? Even if the image URL refers to a PHP script, the script will be run
at _irregular_ and _unpredictable_ intervals: when the page is accessed by
someone using a browser that loads images.

If you just want to run a PHP script when a page is accessed, just make the
page a PHP page so that the PHP code first executes whatever you like and
then generates and sends the page.

If you need further help with this, please note that _this_ group discusses
HTML authoring for the HTML, and PHP and other server-side techniques are
not HTML.

> At the same time, though, it wouldn't be all that spectacular if the
> script was always the last thing to load on the page. If it were,
> then people could just click another link and load another page before
> the image on the first page had a chance to load.

What are you talking about?

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Back to top
Andy Dingley

External


Since: Feb 14, 2004
Posts: 1110



(Msg. 8) Posted: Fri Aug 10, 2007 9:40 pm
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

On Fri, 10 Aug 2007 03:47:53 -0000, yawnmoth <terra1024.RemoveThis@yahoo.com>
wrote:

>(I'm asking because I'm using a 1x1 image to simulate a cron job)

This is a crazy idea. Use a cron job. Use the Windows At service if you
must.

I suspect you plan to you a client-side <meta> refresh on some trivial
page, or else a HTTP header refresh and you 1x1 pixel gif.

OK, so this will "work", for enormously ugly values of "work". But
something that adminsters a server by relying on a client trying to
connect to it regularly is just perverse.

>How might I go about making it so a particular image
>loads before any of these others?

Load it first in a separate HTTP transaction, then redirect to the full
page with all the others. Then redirect back after the time delay (and
repeat).

PS - you can't control the order that things on a page will load, except
that if there are only a few, then the smallest will probably finish
first.
Back to top
Scott Bryce

External


Since: Apr 12, 2004
Posts: 52



(Msg. 9) Posted: Sun Aug 12, 2007 7:59 am
Post subject: Re: making it so a particular image is the first thing loaded
Archived from groups: per prev. post (more info?)

Jukka K. Korpela wrote:

> After you were told that HTML does not deal with such issues (which
> is what you should have known already), there was no point to babble
> here any more.

I asked him to.


> It was reasonable to ask what your _real_ problem was, since it is
> possible that the real problem has an HTML solution, or at least some
> HTML relevance.

Actually, it looked to me like his real problem would need a server-side
solution. I was thinking that we could point him to a better resource
than this newsgroup if we knew what he was trying to accomplish.


> You're looking for reactions to unpredictable events as a solution to
> your (assumed) problem of scheduled runs.

That is true. If those unpredictable events happen often enough, and the
scheduled runs don't have to be right on schedule, this solution may be
good enough.

The OP should google "fake cron." I've seen something written in Perl. I
don't know if there is a PHP fake cron, but perhaps the OP can take
ideas from a Perl fake cron and write his own in PHP.
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> HTML
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum