473,406 Members | 2,371 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,406 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 4719
"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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.