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

Wisdom requested on miscreant rotating banner! (image caching)

Hi,
I have been trying to put together a rotating banner. the code works
but I am having a problem with the caching of the banner images. no
matter what I try the page is constantly reloading the images, even
worse they are not loading completely. This version includes a (vain)
attempt at forcing the banner images to cache.
Apart form the caching problem the scripting seems to work

Any help welcomed:

Grunt

The code is
---------------------------------- in HEAD --------------------------
<script language="JavaScript" TYPE="text/javascript">
<!--
bannerImage1= new Image();
bannerImage2= new Image();
bannerImage3= new Image();
bannerImage4= new Image();
bannerImage1.src= "pageimages/banner1.gif";
bannerImage2.src= "pageimages/banner2.gif";
bannerImage3.src= "pageimages/banner3.gif";
bannerImage4.src= "pageimages/banner4.gif";
bannerImages = new
Array(bannerImage1,bannerImage2,bannerImage3,banne rImage4);
bannerLink = new
Array("firstbannerpage.html","secondbannerpage.htm l","thirdbannerpage.html","fourthbannerpage.html") ;
altLink = new Array("first link alt text","second link alt
text","third link alt text","fourth link alt text");
adIndex = 0;
adCount = bannerImages.length;

function bannerPage() {
var adPage = bannerLink[adIndex];
window.location = adPage;
}

function bannerAd() {
// control the rotating banners. The data objects are held in calling
page.
if (document.images) {
if (document.adImage.complete) {
adIndex++;
if (adIndex == adCount) {
adIndex=0;
}

document.adImage.src=bannerImages[adIndex].src;
document.adImage.alt=altLink[adIndex];

setTimeout("bannerAd()", 4*1000);
}
}
}
// -->
</SCRIPT>

----------------------- AND IN THE BODY ----------------------------
<BODY BGCOLOR="#FFFFFF" onLoad="bannerAd()">

<script language="JavaScript" type="text/javascript">
<!--
if (document.images)
{
document.write("<a href='javascript:bannerPage()'
<img src='pageimages/banner1.gif' name='adImage' width='453'

height='100' border='0' id='adImage'><\/a>")
}
else
{
document.write("<a href='firstbannerpage.html' ><span
class='content-head-purple12' id='headHiLite'>Get your hi-fi+
e-edition by clicking here<\/span><\/a>")
}
// -->
</script>
<noscript id="AltBanner">
<a href="firstbannerpage.html" ><img
src="pageimages/banner1.gif" name="adImage" width="453" height="100"
border="0" id="adImage"></a>
</noscript>

</body>

"In this world you can be either very very smart or very very pleasant. For
years I was smart.. I recommend pleasant". The wisdom of Elwood P. Dowd
Remove "removethis." to email
Jul 23 '05 #1
1 2074
On Wed, 22 Sep 2004 18:49:30 GMT,
gr***@p1tman.removethispart.demon.co.uk (Grunt) wrote:
Hi,
I have been trying to put together a rotating banner. the code works
but I am having a problem with the caching of the banner images. no
matter what I try the page is constantly reloading the images, even
worse they are not loading completely. This version includes a (vain)
attempt at forcing the banner images to cache.
Apart form the caching problem the scripting seems to work

Any help welcomed:

Grunt


Can't help with the technical issue, but may I say that I am impressed
that you ask for wisdom rather than knowledge?

I hope this will extend to accepting that the answer might be "Don't
do this - it looks awful, is difficult for disabled access (which will
contravene legislation in both the USA and the EU) and irritates a lot
of people"?

Paul
Jul 23 '05 #2

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

Similar topics

0
by: Craig S. Ugoretz | last post by:
Dear newgroup readers, I am pleased to announce the presentation of the new open source software project I have created, called the "Wisdom Seeker IDE". For a description of what open source...
2
by: Derek | last post by:
I have some third party sponsor banners on my website and since installing the entire page pauses loading then displays the whole page. It seems that the page is waiting on the banners. Is there a...
5
by: | last post by:
(subject included - apologies) <jason@catamaranco.com> wrote in message news:... > Is there a simple way to track users leaving our site to vendors whose wares > we have advertised as a banner...
4
by: Ian Hubling | last post by:
I'm trying to complete a rotating banner ad within a page I have. The rotating add has four images that rotate in three-second increments. I've got the images to rotate ok - but now I want to go...
4
by: Roozbeh GHolizadeh | last post by:
Hi there... i think it is a very common problem but i dont know why i didnt find anything good for me on internet... i want to simply rotate an array with 90,180,270 degrees.... here is how...
5
by: Gabriel Lozano-Morán | last post by:
Is there any particular reason why the Session_Start() event gets triggerend by each aspx page request? Details: Windows XP Pro SP2 ..NET Framework v1.1.4322 C# SessionState set to mode...
3
by: | last post by:
I want a banner to appear at the bottom of each page of a web app. I created a user control that describes the banner and have it placed in all my pages. For the most part it functions as needed....
2
by: mistral | last post by:
I want place custom text rotating around analogue clock. Here is javascript that is clise to my task: http://javascript.internet.com/time-date/mousetrailclock.html But it have a few...
0
by: mmcgee00 | last post by:
Hi, Currently, I am trying to get different service banner by connecting to different ports using python (code below). The versions I am working with are python 4.2.1 and fedora core 4. I am...
0
by: jasone | last post by:
Hey guys, im creating a website that will be mostly powered by php. I will start by giving you some backgroound: I want the website to be totally dependant, so the user can update it all...
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
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.