473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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)

Aug 10 '07 #1
8 1974
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?
Aug 10 '07 #2

yawnmoth <te*******@yahoo.comwrote:
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, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"I can take one day at a time, but sometimes several days attack me at once."
Aug 10 '07 #3
On Aug 9, 11:30 pm, Scott Bryce <sbr...@scottbryce.comwrote:
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.

Aug 10 '07 #4
On Aug 9, 11:47 pm, yawnmoth <terra1...@yahoo.comwrote:
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

Aug 10 '07 #5
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/

Aug 10 '07 #6
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/

Aug 10 '07 #7
On Aug 10, 11:58 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsityawnmoth:
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?
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?
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.

Aug 12 '07 #8
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.
Aug 12 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gregory | last post by:
Hello, I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the...
3
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up...
4
by: Christina Androne | last post by:
Hi I want to allow the user to drow some locators on an image and connect the locators with lines. So I tried to put the following code in the onmousedown enevt of the picture: Graphics...
12
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
9
by: Mark Denardo | last post by:
This is related to another post I submitted, but I'll be more precise this time. I have a web page that contains an Image webcontrol that loads its image by: Image1.ImageUrl="<username>.jpg",...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
0
by: numbnutz | last post by:
Hi, I am currently working on an XML Gallery for my girlfriend's brother who is a photographer. I have created a flash front end template and am using an XML database to load the images and...
3
by: kayahr | last post by:
Hi there, I have a strange problem in Internet Explorer (IE6 and IE7). I'm writing a JavaScript application which allows the user to edit a photo composition. So when the user selects a photo then...
6
by: Jerry West | last post by:
I'm a newbie to .NET from VB6. I have a Form with a Panel control on it. When the Form loads it maximizes and so does the Panel control. I then fill an array with the path to images at a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.