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

Changing div content onload

Hi everyone,

I am looking for a script that will allow me to have the HTML content of a div tag (text and graphics) change when a page is refreshed. I would also like it to randomly choose between the available content for each page load. I am hoping that returning customers will see new featured content each time they visit.

Thank you for your help. I can usually find scripts that will work for my purposes or can be modified pretty easily, but this one has been difficult.
Jul 13 '07 #1
1 2050
acoder
16,027 Expert Mod 8TB
Store the available content in an array (or two arrays for text and image source). Then use Math.random() to choose one of them randomly.
Jul 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jenny | last post by:
In the code below, I can write html content var t='<body BGCOLOR=blue>' for a new window. But if it contains javascript, such as var t='<body onload="window.open('new1.html')">', this code will...
10
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be...
6
by: tshad | last post by:
Is there a way during Page_Load to change or add an attribute to the Body tag? I want to be able to change the onLoad body attribute to do a focus on one of my text boxes, such as: ...
12
by: Nico Schuyt | last post by:
Maybe a stupid question (I'm not so familiar with javascript), but: I want to change background of a paragraph or list item on mouseover. The following code works: <p...
4
by: Siah | last post by:
Hi, I wanted to dynamically update pieces of my page in the following fashion. Look at the following html code: <span id='person_23_name'> Mike </span> <span id='person_28_name'> Siah </span>...
2
by: Casey Miller | last post by:
I have a site, http://www.onemorewebsite.com, that has a menu on the left side and a picture on the right side with a middle div for content in the middle. When I mouse over the menu, the picture...
9
by: aatcbbtccctc | last post by:
Hi folks I've googled for an answer to this, with no success. Can someone please jump in, and put me out of my misery! (I'm sure it's quite simple) I have an invisible IFRAME, and a visible...
6
ak1dnar
by: ak1dnar | last post by:
Hi, I am developing a web site that displays Products, and along with each products there is a Button.There is a <DIV> in my page to display Number of Products Added to the Basket. Items : 0 ...
5
by: ~~~ .NET Ed ~~~ | last post by:
Well the subject says it all but I am going to elaborate a bit. As we all now since 2.0 it is possible to access the Header from code behind without much wizardry and that is a good thing. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
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...

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.