473,287 Members | 1,643 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,287 software developers and data experts.

how to load a different image on a web page

Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?
Thanks,
yip

Feb 5 '07 #1
6 4715
"ipy2006" <ip*******@gmail.comwrites:
Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?
This is a case for a server-side script. It is a matter of a few
minutes and will work for all your visitors (that view images).

The "other than" is rather odd since JS will not work "every time" but
only some times.

--
Ben.
Feb 5 '07 #2
On Feb 5, 1:03 pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote:
"ipy2006" <ipyasa...@gmail.comwrites:
Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?

This is a case for a server-side script. It is a matter of a few
minutes and will work for all your visitors (that view images).

The "other than" is rather odd since JS will not work "every time" but
only some times.

--
Ben.
Thanks for the reply. If you look at http://www.nyu.edu everytime you
open this url in a browser you will see a new <divelement. Do you
think it is created by a server side script or by some Ajax code? From
my observation I don't see any server side code there. Please comment.

<div id="photography">
<img src="/v50/images/photos/42/4x2_35980Pg20.jpg" alt="" />
</div>

Feb 5 '07 #3
On 02/05/2007 01:14 PM, ipy2006 wrote:
On Feb 5, 1:03 pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote:
>"ipy2006" <ipyasa...@gmail.comwrites:
>>Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?
This is a case for a server-side script. It is a matter of a few
minutes and will work for all your visitors (that view images).

The "other than" is rather odd since JS will not work "every time" but
only some times.

--
Ben.

Thanks for the reply. If you look at http://www.nyu.edu everytime you
open this url in a browser you will see a new <divelement. Do you
think it is created by a server side script or by some Ajax code? From
my observation I don't see any server side code there. Please comment.

<div id="photography">
<img src="/v50/images/photos/42/4x2_35980Pg20.jpg" alt="" />
</div>
Server-side code is executed on the server to (typically) generate the
HTML that you see. You can probably do what you're trying to do by using
a combination of a cookie and a server-side script.
--
Windows Vista and your freedom in conflict:
http://www.securityfocus.com/columnists/420/2
Feb 5 '07 #4
"ipy2006" <ip*******@gmail.comwrites:
On Feb 5, 1:03 pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote:
>"ipy2006" <ipyasa...@gmail.comwrites:
Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?

This is a case for a server-side script. It is a matter of a few
minutes and will work for all your visitors (that view images).

The "other than" is rather odd since JS will not work "every time" but
only some times.

Thanks for the reply. If you look at http://www.nyu.edu everytime you
open this url in a browser you will see a new <divelement. Do you
think it is created by a server side script or by some Ajax code? From
my observation I don't see any server side code there. Please
comment.
The photos appear (and change) when all client-side scripting is off
so a server-side script is probably generating the changed content.
You say you can't see any server code there, but server-side code is
almost always hidden.

There is also a lot of client-side scripting on the page so when that
is active it may also do changing the content. I did not try to find
out what any of it did. Browser sniffing, like glue sniffing, makes
my head hurt.

--
Ben.
Feb 5 '07 #5

"ipy2006" <ip*******@gmail.comwrote in message
news:11*********************@a75g2000cwd.googlegro ups.com...
Other than the JavaScript of timing and rotating images every few
seconds or minutes, is there a way to uniquely load a different
picture every time a browser open a page?
Thanks,
yip
php
http://alistapart.com/articles/randomizer/
Feb 5 '07 #6
Ben Bacarisse wrote [in part]:
"ipy2006" <ip*******@gmail.comwrites:
>Thanks for the reply. If you look at http://www.nyu.edu everytime you
open this url in a browser you will see a new <divelement. Do you
think it is created by a server side script or by some Ajax code? From
my observation I don't see any server side code there. Please
comment.

The photos appear (and change) when all client-side scripting is off
so a server-side script is probably generating the changed content.
You say you can't see any server code there, but server-side code is
almost always hidden.
A server-side include (SSI) script executes on the Web server before the
requested Web page is sent. If the SSI affects content within the page,
that effect appears as if pre-coded into the page. You do not see the
SSI itself.

If you go to my home page (see signature below), scroll to the bottom,
and select the link "Index of HTML Files", you will get a page with the
index of all HTML files on my site. This is generated by a SSI called
from <http://www.rossde.com/get_index.html>. If you look at the source
HTML of that page, you will see the table structure of the display. You
will NOT see the UNIX Korn shell SSI script -- named get_index.ksh --
that generated the source HTML. You will not even see the call to
get_index.ksh, which the Web server replaced with the results of
executing that SSI.

The same is true of the "hit" counters in my pages; the count looks
hard-coded into the HTML. I see the calls to the SSIs when I view my
HTML on my server, which you can't see because you don't have access. I
also see the calls in the HTML on my PC, where I develop and maintain my
pages before uploading to the server. If I view one of those pages in a
browser, the results of an SSI is a blank because my PC is not a server
and thus can't execute the SSI. If I view one of my pages by loading it
from the server, I see the SSI results. If I then download that page to
my PC, the HTML contains the results of the SSI, not the call to it.

--

David E. Ross
<http://www.rossde.com/>

I use SeaMonkey as my Web browser because I want
a browser that complies with Web standards. See
<http://www.mozilla.org/projects/seamonkey/>.
Feb 6 '07 #7

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

Similar topics

1
by: Charlie | last post by:
Hi I am using the following code to create an image viewer for multiple images. var pageImage = document.images; var image = new Image(); var args = GetQuerystring(); //return arguments from...
2
by: Mehdi | last post by:
Hi, I have 3 small images on my page. I also have a large image which is displayed when any of the 3 small images is clicked. I do this to display a large version of each image. On page load...
5
by: Asa Monsey | last post by:
I am having a problem that the page load event fires twice in reponse to an autopostback. The first time, the IsPostBack property is true, and the second time it it false. This is causing many...
3
by: Mike Dee | last post by:
Hi, I'm having an issue with the status bar in Mozilla and Netscape showing that it is still waiting on the page to load even after it is finished. This problem does NOT occur with IE. In...
61
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the...
4
by: ReGenesis0 | last post by:
Okay, this involves integrating javascript with PHP (though you don't have to know PHP to understand my question.) I have a page. It has a link. When someoen clicks on the link, iw ant to...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
2
by: ricardo.sobral.santos | last post by:
Hello, I am trying to get the value of the radiobuttonlist. The problem is that I need it to be unselected at every page load. The radiobuttonlist is set to autopostback (true). My idea is...
0
by: Jim in Arizona | last post by:
When the page loads, a dropdownlist is populated from a table. I populate the DataTextField with a persons name, and the DataValueField with the ID of the table (the key field) for further...
7
by: amishguy | last post by:
Hello, I am having an issue with a site I'm creating right now. I have had this issue before and I would like to figure out what the solution is instead of using workarounds as I have in the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.