
August 10th, 2007, 04:55 AM
| | | making it so a particular image is the first thing loaded
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) | 
August 10th, 2007, 05:35 AM
| | | Re: making it so a particular image is the first thing loaded
yawnmoth wrote: Quote:
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. Quote: |
(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? | 
August 10th, 2007, 07:15 AM
| | | Re: making it so a particular image is the first thing loaded
yawnmoth <terra1024@yahoo.comwrote: Quote:
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@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, darin@htmlhelp.com, http://www.HTMLHelp.com/
"I can take one day at a time, but sometimes several days attack me at once." | 
August 10th, 2007, 01:45 PM
| | | Re: making it so a particular image is the first thing loaded
On Aug 9, 11:30 pm, Scott Bryce <sbr...@scottbryce.comwrote: Quote:
yawnmothwrote: Quote:
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.
> Quote: |
(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. | 
August 10th, 2007, 05:15 PM
| | | Re: making it so a particular image is the first thing loaded
On Aug 9, 11:47 pm, yawnmoth <terra1...@yahoo.comwrote: Quote:
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 | 
August 10th, 2007, 05:55 PM
| | | Re: making it so a particular image is the first thing loaded
Scripsit Helpful person: Quote: |
You can use the onload element
| You didn't really understand the question, did yoy? 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/ | 
August 10th, 2007, 05:55 PM
| | | Re: making it so a particular image is the first thing loaded
Scripsit yawnmoth: Quote:
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. Quote:
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/ | 
August 12th, 2007, 02:35 AM
| | | Re: making it so a particular image is the first thing loaded
On Aug 10, 11:58 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote: Quote:
Scripsityawnmoth:
> Quote: |
What are you ultimately trying to accomplish?
| > Quote:
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?
| It isn't. That's why I didn't volunteer the information. What I was
asking wasn't how to do this - it was "how to make it so a particular
image loads first". Was there some HTML markup that'd allow me to do
this? Quote:
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.
| No shit. But if your webhost doesn't let you do cron jobs or use the
Windows Scheduler, or whatever, it may be the best option you got.
But what does any of this have to do with html authoring? I suggest
you drop this line of inquiry since it *is*, after all, off topic,
here. The only thing that is on topic here is whether or not you can
make an image load before others and that question has been answered. | 
August 12th, 2007, 03:05 PM
| | | Re: making it so a particular image is the first thing loaded
Jukka K. Korpela wrote: Quote:
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. Quote:
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. Quote:
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. |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|