ots287
|
| Posted: 08/27/2004, 9:30 PM |
|
When I add a javascipt in a asp page I get:
VBScript runtime error '800a0009'
Subscript out of range: '-1'
/mwmcaapps/Template.asp, line 161
This is my Java Script:
<!-- JavaScript Banner Rotator - Rotate banners in order after a set period of time.
<!-- Put this text in the HEAD section of the HTML -->
<div align="center">
<script language="JavaScript">
<!--
var AdNum = 0;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this = initArray.arguments;
}
}
links = new initArray(
"domainurl",
"domainurl"
)
images = new initArray(
"http://www.domainname.org/images/1.gif",
"http://www.domainname.org/images/2.gif"
)
alttext = new initArray(
"OpenTech",
"WebOffice"
)
// -->
</script>
<!-- End Banner Rotator HEAD Code -->
<!-- JavaScript Banner Rotator - Rotate banners in order after a set period of time.
<!-- Put this text in the BODY section of the HTML -->
<script language="JavaScript">
<!--
var bannerlink = "http://www.domainname"
function rotatebanners() {
if (AdNum == 2) {
AdNum = 0
}
document.BannerAd.src=images[AdNum]
document.BannerAd.alt=alttext[AdNum]
setTimeout("rotatebanners()",5000)
bannerlink = links[AdNum]
AdNum++
}
function changelink() {
location = bannerlink
}
// -->
</script>
<a href='javascript:changelink()'><img src="http://www.domainname.org/images/1.gif" name="BannerAd" alt="" ></a>
<script language="JavaScript">
rotatebanners();
</script>
<!-- End Banner Rotator BODY Code -->
|
|
|
 |
DonB
|
| Posted: 08/28/2004, 6:01 AM |
|
Just offhand, I'd guess it's due to the <!-- End Banner ... --> being
interpreted as a Template block by CCS. There is no appropriate <!-- Begin
Banner ... --> to make a complete pair.
I'd try to put the bulk of the javascript into a <SCRIPT src="some URL" />
tag and keep the clutter out of the main file.
And, I'm assuming you REALLY put this into the HTML file, not the "asp
page"?
--
DonB
http://www.gotodon.com/ccbth
"ots287" <ots287@forum.codecharge> wrote in message
news:641300a717d788@news.codecharge.com...
> When I add a javascipt in a asp page I get:
>
> VBScript runtime error '800a0009'
>
> Subscript out of range: '-1'
>
> /mwmcaapps/Template.asp, line 161
>
> This is my Java Script:
>
> <!-- JavaScript Banner Rotator - Rotate banners in order after a set
period of
> time.
> <!-- Put this text in the HEAD section of the HTML -->
> <div align="center">
> <script language="JavaScript">
> <!--
> var AdNum = 0;
>
> function initArray() {
> this.length = initArray.arguments.length;
> for (var i = 0; i < this.length; i++) {
> this = initArray.arguments;
> }
> }
>
> links = new initArray(
> "domainurl",
> "domainurl"
> )
>
>
> images = new initArray(
> "http://www.domainname.org/images/1.gif",
> "http://www.domainname.org/images/2.gif"
> )
>
>
> alttext = new initArray(
> "OpenTech",
> "WebOffice"
> )
>
> // -->
> </script>
> <!-- End Banner Rotator HEAD Code -->
> <!-- JavaScript Banner Rotator - Rotate banners in order after a
set
> period of time.
> <!-- Put this text in the BODY section of the HTML -->
> <script language="JavaScript">
> <!--
> var bannerlink = "http://www.domainname"
> function rotatebanners() {
> if (AdNum == 2) {
> AdNum = 0
> }
> document.BannerAd.src=images[AdNum]
> document.BannerAd.alt=alttext[AdNum]
> setTimeout("rotatebanners()",5000)
> bannerlink = links[AdNum]
> AdNum++
> }
>
> function changelink() {
> location = bannerlink
> }
> // -->
> </script>
> <a href='javascript:changelink()'><img
> src="http://www.domainname.org/images/1.gif" name="BannerAd" alt="" ></a>
> <script language="JavaScript">
> rotatebanners();
> </script>
> <!-- End Banner Rotator BODY Code -->
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
ypmuds2
|
| Posted: 09/26/2004, 3:25 PM |
|
why can i play ,,pogo .com ,it lets me load but not play just hangs there
|
|
|
 |
|