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

Javascript works locally but not on the server

I have a simple rotating banner javascript on the site I'm developing. It works perfectly locally but once I upload it to the server it doesn't. Is there something wrong with my code? Why would it work locally and not live? Here's the relevant code:

<head>

<script language="Javascript" type="text/javascript">
adImages = new Array("images/AMSite18.png","images/AMSite19.png","images/AMSite09b.png")
thisAd = 0
imgCt = adImages.length

function rotate() {
if (document.images) {
thisAd++
if (thisAd == imgCt) {
thisAd = 0
}

document.adBanner.src=adImages[thisAd]
setTimeout("rotate()", 3 * 1000)
}
}
</script>
</head>

<body onload="rotate()">
<div id="banner">
<img src="images/banner1.gif" name="adBanner" alt="Ad Banner" />
</div><!-- end banner -->

</div><!-- end header -->
</body>
Apr 28 '11 #1
1 2501
Actually, I tested it in IE, Firefox and Safari and it DOES work in those browsers. It doesn't work in Chrome though! Anyone know why!?
Apr 28 '11 #2

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

Similar topics

2
by: Gaurav | last post by:
Hello, How can i connect client side javascript to sql server 2000 ? Thanks. Gaurav
33
by: n00m | last post by:
import socket, thread host, port = '192.168.0.3', 1434 s1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s2.connect((host, 1433))...
1
by: Andy | last post by:
We have an ASP.NET application exported from MS Access 2003. I uses a series of queries to generate a page showing todays bookings. It works locally but does not work when we put it on a...
1
by: Steve Murphy | last post by:
How do you determine whether JavaScript is enabled from your C# code on the server-side? Thanks.
5
by: Peter Michaux | last post by:
Hi, I might be turning a corner today and seeing the light. I might still be confused :) If JavaScript is the language for the browser then why do servers use Ruby/Rails, Perl/Catalyst,...
3
by: Jayprakash | last post by:
I want to access one javascript variable to server side how can i do it?
1
by: Andyza | last post by:
With reference to the ASPFAQ 2161 article - http://classicasp.aspfaq.com/general/how-do-i-prompt-a-save-as-dialog-for-an-accepted-mime-type.html Does the 'Content-Disposition' code work if the...
10
by: rbenditt | last post by:
I've put together a simple script that uses the XMLHttpRequest() function. It works when I run it locally, but when I upload it to my web hosting account, I never get a response back. Here is what I...
2
by: dogged | last post by:
Website works locally but not when deployed ================================== Can someone please help with what I hope is a common problem (I’m new to .net). I have a simple website generated...
5
by: Corrie | last post by:
Hi, I've been trying to create a menu with animated mouseOvers using script instead of Flash. It works locally in Firefox but won't load at all in Safari (blank page). Then when I upload it to the...
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: 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: 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:
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
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,...

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.