Javascript banner advertising problem

O

Ollie

Hello, not sure if anyone can help me but Ive found the below script online
and want to use it on my FP 2003 website however when I insert it into my
page it doesnt work and all i get is the top two pictures fading into two
others once and then I get an error message at the bottom left of the screen
sayign "error on page" and then this turns into "Done". The pictures are then
static when all five should be fading into one another continuously . If I
run the code exactly as below everything works fine. I've done some
investigating on the web and found that it might be something to do with the
tables on the page where I want to insert the banners/fading pictures,
without any content in the body it works fine. Any ideas if its possible to
solve this issue or is this code a lost cause? Any assisstance is gratefully
received! :eek:)
Regards
Ollie




<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>

<script Language="JavaScript">
<!--
///////////////////
//www.fortochka.com
//Alexander Babichev 2006 Coopyright
//This script is free for private use. Otherwise a $10 fee per a site is
required.
//the script can be modified but the copyright notice should be left
unchanged.
///////////////////

var speed = 8000

function item(name, link){
this.name = name
this.link = link
}

var bannerArr = new Array

bannerArr[0] = new
item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
bannerArr[1] = new
item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
bannerArr[2] = new
item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
bannerArr[3] = new
item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
bannerArr[4] = new
item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
bannerArr[5] = new
item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")

var kk = bannerArr.length
var ii
var imgArray = new Array()

for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = bannerArr[ii].name
}

function displayBanners(){
document.write('<table>')
for (ii=0;ii<kk-1;ii++){
document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
border=0></a></td></tr>')
}
document.write('</table>')
myPause = setInterval("ready()",1000)
}

function ready(){
var start = true
for (ii=0;ii<kk;ii++){
if (imgArray[ii].complete == false){
start = false
}
}

if (start == true){
window.clearInterval(myPause)
myInterval = setInterval("show()",speed)
}
}

var numArray = new Array()
for (ii=0;ii<kk;ii++){
numArray[ii] = ii
}

function show(){
for (ii=0;ii<kk-1;ii++){
numArray[ii] = numArray[ii] - 1
if (numArray[ii] == -1){
numArray[ii] = kk-1
}
}

for (ii=0;ii<kk-1;ii++){
if (document.all){
eval('img' + ii).style.filter="blendTrans(duration=3)";
eval('img' + ii).filters.blendTrans.Apply();
eval('img' + ii).filters.blendTrans.Play();
}
eval('document.img' + ii).src = imgArray[numArray[ii]].src
eval("document.getElementById('a" + ii + "')").href =
bannerArr[numArray[ii]].link
}
}

function openNewWindow(href){
var newWindow
newWindow =
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
}
// -->
</script>


</head>

<body>

<script Language="JavaScript">displayBanners()</script>
</body>

</html>
 
E

E. T. Culling

Ask the person who wrote the script!

--
Eleanor T. Culling
Leavenworth, WA
Enjoy my photography at
www.eleanorstravels.com
Ollie said:
Hello, not sure if anyone can help me but Ive found the below script
online
and want to use it on my FP 2003 website however when I insert it into my
page it doesnt work and all i get is the top two pictures fading into two
others once and then I get an error message at the bottom left of the
screen
sayign "error on page" and then this turns into "Done". The pictures are
then
static when all five should be fading into one another continuously . If I
run the code exactly as below everything works fine. I've done some
investigating on the web and found that it might be something to do with
the
tables on the page where I want to insert the banners/fading pictures,
without any content in the body it works fine. Any ideas if its possible
to
solve this issue or is this code a lost cause? Any assisstance is
gratefully
received! :eek:)
Regards
Ollie




<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>

<script Language="JavaScript">
<!--
///////////////////
//www.fortochka.com
//Alexander Babichev 2006 Coopyright
//This script is free for private use. Otherwise a $10 fee per a site is
required.
//the script can be modified but the copyright notice should be left
unchanged.
///////////////////

var speed = 8000

function item(name, link){
this.name = name
this.link = link
}

var bannerArr = new Array

bannerArr[0] = new
item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
bannerArr[1] = new
item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
bannerArr[2] = new
item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
bannerArr[3] = new
item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
bannerArr[4] = new
item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
bannerArr[5] = new
item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")

var kk = bannerArr.length
var ii
var imgArray = new Array()

for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = bannerArr[ii].name
}

function displayBanners(){
document.write('<table>')
for (ii=0;ii<kk-1;ii++){
document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
bannerArr[ii].link + ' onClick="openNewWindow(this.href);return
false;"><img
src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
border=0></a></td></tr>')
}
document.write('</table>')
myPause = setInterval("ready()",1000)
}

function ready(){
var start = true
for (ii=0;ii<kk;ii++){
if (imgArray[ii].complete == false){
start = false
}
}

if (start == true){
window.clearInterval(myPause)
myInterval = setInterval("show()",speed)
}
}

var numArray = new Array()
for (ii=0;ii<kk;ii++){
numArray[ii] = ii
}

function show(){
for (ii=0;ii<kk-1;ii++){
numArray[ii] = numArray[ii] - 1
if (numArray[ii] == -1){
numArray[ii] = kk-1
}
}

for (ii=0;ii<kk-1;ii++){
if (document.all){
eval('img' + ii).style.filter="blendTrans(duration=3)";
eval('img' + ii).filters.blendTrans.Apply();
eval('img' + ii).filters.blendTrans.Play();
}
eval('document.img' + ii).src = imgArray[numArray[ii]].src
eval("document.getElementById('a" + ii + "')").href =
bannerArr[numArray[ii]].link
}
}

function openNewWindow(href){
var newWindow
newWindow =
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
}
// -->
</script>


</head>

<body>

<script Language="JavaScript">displayBanners()</script>
</body>

</html>
 
S

Steve Easton

I didn't write it, but I don't understand the double link for each "item."

item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")

Also, the script uses transitions and transitions only work in Internet Explorer.


--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm


Ollie said:
Hello, not sure if anyone can help me but Ive found the below script online
and want to use it on my FP 2003 website however when I insert it into my
page it doesnt work and all i get is the top two pictures fading into two
others once and then I get an error message at the bottom left of the screen
sayign "error on page" and then this turns into "Done". The pictures are then
static when all five should be fading into one another continuously . If I
run the code exactly as below everything works fine. I've done some
investigating on the web and found that it might be something to do with the
tables on the page where I want to insert the banners/fading pictures,
without any content in the body it works fine. Any ideas if its possible to
solve this issue or is this code a lost cause? Any assisstance is gratefully
received! :eek:)
Regards
Ollie




<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>

<script Language="JavaScript">
<!--
///////////////////
//www.fortochka.com
//Alexander Babichev 2006 Coopyright
//This script is free for private use. Otherwise a $10 fee per a site is
required.
//the script can be modified but the copyright notice should be left
unchanged.
///////////////////

var speed = 8000

function item(name, link){
this.name = name
this.link = link
}

var bannerArr = new Array

bannerArr[0] = new
item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
bannerArr[1] = new
item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
bannerArr[2] = new
item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
bannerArr[3] = new
item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
bannerArr[4] = new
item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
bannerArr[5] = new
item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")

var kk = bannerArr.length
var ii
var imgArray = new Array()

for (ii=0;ii<kk;ii++){
imgArray[ii] = new Image()
imgArray[ii].src = bannerArr[ii].name
}

function displayBanners(){
document.write('<table>')
for (ii=0;ii<kk-1;ii++){
document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
border=0></a></td></tr>')
}
document.write('</table>')
myPause = setInterval("ready()",1000)
}

function ready(){
var start = true
for (ii=0;ii<kk;ii++){
if (imgArray[ii].complete == false){
start = false
}
}

if (start == true){
window.clearInterval(myPause)
myInterval = setInterval("show()",speed)
}
}

var numArray = new Array()
for (ii=0;ii<kk;ii++){
numArray[ii] = ii
}

function show(){
for (ii=0;ii<kk-1;ii++){
numArray[ii] = numArray[ii] - 1
if (numArray[ii] == -1){
numArray[ii] = kk-1
}
}

for (ii=0;ii<kk-1;ii++){
if (document.all){
eval('img' + ii).style.filter="blendTrans(duration=3)";
eval('img' + ii).filters.blendTrans.Apply();
eval('img' + ii).filters.blendTrans.Play();
}
eval('document.img' + ii).src = imgArray[numArray[ii]].src
eval("document.getElementById('a" + ii + "')").href =
bannerArr[numArray[ii]].link
}
}

function openNewWindow(href){
var newWindow
newWindow =
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
}
// -->
</script>


</head>

<body>

<script Language="JavaScript">displayBanners()</script>
</body>

</html>
 
S

Stefan B Rusynko

Its an ad banner
- parameter 1 is the Ad image
- parameter 2 is the Ad link

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I didn't write it, but I don't understand the double link for each "item."
|
| item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
|
| Also, the script uses transitions and transitions only work in Internet Explorer.
|
|
| --
| Steve Easton
| Microsoft MVP FrontPage
| FP Cleaner
| http://www.95isalive.com/fixes/fpclean.htm
| Hit Me FP
| http://www.95isalive.com/fixes/HitMeFP.htm
|
|
| | > Hello, not sure if anyone can help me but Ive found the below script online
| > and want to use it on my FP 2003 website however when I insert it into my
| > page it doesnt work and all i get is the top two pictures fading into two
| > others once and then I get an error message at the bottom left of the screen
| > sayign "error on page" and then this turns into "Done". The pictures are then
| > static when all five should be fading into one another continuously . If I
| > run the code exactly as below everything works fine. I've done some
| > investigating on the web and found that it might be something to do with the
| > tables on the page where I want to insert the banners/fading pictures,
| > without any content in the body it works fine. Any ideas if its possible to
| > solve this issue or is this code a lost cause? Any assisstance is gratefully
| > received! :eek:)
| > Regards
| > Ollie
| >
| >
| >
| >
| > <html>
| >
| > <head>
| > <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| > <title>New Page 1</title>
| >
| > <script Language="JavaScript">
| > <!--
| > ///////////////////
| > //www.fortochka.com
| > //Alexander Babichev 2006 Coopyright
| > //This script is free for private use. Otherwise a $10 fee per a site is
| > required.
| > //the script can be modified but the copyright notice should be left
| > unchanged.
| > ///////////////////
| >
| > var speed = 8000
| >
| > function item(name, link){
| > this.name = name
| > this.link = link
| > }
| >
| > var bannerArr = new Array
| >
| > bannerArr[0] = new
| > item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
| > bannerArr[1] = new
| > item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
| > bannerArr[2] = new
| > item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
| > bannerArr[3] = new
| > item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
| > bannerArr[4] = new
| > item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
| > bannerArr[5] = new
| > item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")
| >
| > var kk = bannerArr.length
| > var ii
| > var imgArray = new Array()
| >
| > for (ii=0;ii<kk;ii++){
| > imgArray[ii] = new Image()
| > imgArray[ii].src = bannerArr[ii].name
| > }
| >
| > function displayBanners(){
| > document.write('<table>')
| > for (ii=0;ii<kk-1;ii++){
| > document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
| > bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
| > src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
| > border=0></a></td></tr>')
| > }
| > document.write('</table>')
| > myPause = setInterval("ready()",1000)
| > }
| >
| > function ready(){
| > var start = true
| > for (ii=0;ii<kk;ii++){
| > if (imgArray[ii].complete == false){
| > start = false
| > }
| > }
| >
| > if (start == true){
| > window.clearInterval(myPause)
| > myInterval = setInterval("show()",speed)
| > }
| > }
| >
| > var numArray = new Array()
| > for (ii=0;ii<kk;ii++){
| > numArray[ii] = ii
| > }
| >
| > function show(){
| > for (ii=0;ii<kk-1;ii++){
| > numArray[ii] = numArray[ii] - 1
| > if (numArray[ii] == -1){
| > numArray[ii] = kk-1
| > }
| > }
| >
| > for (ii=0;ii<kk-1;ii++){
| > if (document.all){
| > eval('img' + ii).style.filter="blendTrans(duration=3)";
| > eval('img' + ii).filters.blendTrans.Apply();
| > eval('img' + ii).filters.blendTrans.Play();
| > }
| > eval('document.img' + ii).src = imgArray[numArray[ii]].src
| > eval("document.getElementById('a" + ii + "')").href =
| > bannerArr[numArray[ii]].link
| > }
| > }
| >
| > function openNewWindow(href){
| > var newWindow
| > newWindow =
| >
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
| > }
| > // -->
| > </script>
| >
| >
| > </head>
| >
| > <body>
| >
| > <script Language="JavaScript">displayBanners()</script>
| > </body>
| >
| > </html>
| >
| > --
| > Regards
| > Ollie
| > :eek:)
|
|
 
S

Steve Easton

Ah,

Thanks Stefan, I wasn't thinking "link"


--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm

Stefan B Rusynko said:
Its an ad banner
- parameter 1 is the Ad image
- parameter 2 is the Ad link

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I didn't write it, but I don't understand the double link for each "item."
|
| item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
|
| Also, the script uses transitions and transitions only work in Internet Explorer.
|
|
| --
| Steve Easton
| Microsoft MVP FrontPage
| FP Cleaner
| http://www.95isalive.com/fixes/fpclean.htm
| Hit Me FP
| http://www.95isalive.com/fixes/HitMeFP.htm
|
|
| | > Hello, not sure if anyone can help me but Ive found the below script online
| > and want to use it on my FP 2003 website however when I insert it into my
| > page it doesnt work and all i get is the top two pictures fading into two
| > others once and then I get an error message at the bottom left of the screen
| > sayign "error on page" and then this turns into "Done". The pictures are then
| > static when all five should be fading into one another continuously . If I
| > run the code exactly as below everything works fine. I've done some
| > investigating on the web and found that it might be something to do with the
| > tables on the page where I want to insert the banners/fading pictures,
| > without any content in the body it works fine. Any ideas if its possible to
| > solve this issue or is this code a lost cause? Any assisstance is gratefully
| > received! :eek:)
| > Regards
| > Ollie
| >
| >
| >
| >
| > <html>
| >
| > <head>
| > <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
| > <title>New Page 1</title>
| >
| > <script Language="JavaScript">
| > <!--
| > ///////////////////
| > //www.fortochka.com
| > //Alexander Babichev 2006 Coopyright
| > //This script is free for private use. Otherwise a $10 fee per a site is
| > required.
| > //the script can be modified but the copyright notice should be left
| > unchanged.
| > ///////////////////
| >
| > var speed = 8000
| >
| > function item(name, link){
| > this.name = name
| > this.link = link
| > }
| >
| > var bannerArr = new Array
| >
| > bannerArr[0] = new
| > item("http://www.mysite.com/images/AD1.gif","http://www.mysite.com")
| > bannerArr[1] = new
| > item("http://www.mysite.com/images/AD2.gif","http://www.mysite.com")
| > bannerArr[2] = new
| > item("http://www.mysite.com/images/AD3.gif","http://www.mysite.com")
| > bannerArr[3] = new
| > item("http://www.mysite.com/images/AD4.gif","http://www.mysite.com")
| > bannerArr[4] = new
| > item("http://www.mysite.com/images/AD5.gif","http://www.mysite.com")
| > bannerArr[5] = new
| > item("http://www.mysite.com/images/AD6.gif","http://www.mysite.com")
| >
| > var kk = bannerArr.length
| > var ii
| > var imgArray = new Array()
| >
| > for (ii=0;ii<kk;ii++){
| > imgArray[ii] = new Image()
| > imgArray[ii].src = bannerArr[ii].name
| > }
| >
| > function displayBanners(){
| > document.write('<table>')
| > for (ii=0;ii<kk-1;ii++){
| > document.write('<tr><td><a ID= a' + ii + ' name= a' + ii + ' href=' +
| > bannerArr[ii].link + ' onClick="openNewWindow(this.href);return false;"><img
| > src=' + imgArray[ii].src + ' name = img' + ii + ' ID = img' + ii + '
| > border=0></a></td></tr>')
| > }
| > document.write('</table>')
| > myPause = setInterval("ready()",1000)
| > }
| >
| > function ready(){
| > var start = true
| > for (ii=0;ii<kk;ii++){
| > if (imgArray[ii].complete == false){
| > start = false
| > }
| > }
| >
| > if (start == true){
| > window.clearInterval(myPause)
| > myInterval = setInterval("show()",speed)
| > }
| > }
| >
| > var numArray = new Array()
| > for (ii=0;ii<kk;ii++){
| > numArray[ii] = ii
| > }
| >
| > function show(){
| > for (ii=0;ii<kk-1;ii++){
| > numArray[ii] = numArray[ii] - 1
| > if (numArray[ii] == -1){
| > numArray[ii] = kk-1
| > }
| > }
| >
| > for (ii=0;ii<kk-1;ii++){
| > if (document.all){
| > eval('img' + ii).style.filter="blendTrans(duration=3)";
| > eval('img' + ii).filters.blendTrans.Apply();
| > eval('img' + ii).filters.blendTrans.Play();
| > }
| > eval('document.img' + ii).src = imgArray[numArray[ii]].src
| > eval("document.getElementById('a" + ii + "')").href =
| > bannerArr[numArray[ii]].link
| > }
| > }
| >
| > function openNewWindow(href){
| > var newWindow
| > newWindow =
| >
window.open(href,"","toolbar=yes,directories=yes,menubar=yes,resizable=yes,location=yes,status=yes,scrollbars=yes,copyhistory=yes")
| > }
| > // -->
| > </script>
| >
| >
| > </head>
| >
| > <body>
| >
| > <script Language="JavaScript">displayBanners()</script>
| > </body>
| >
| > </html>
| >
| > --
| > Regards
| > Ollie
| > :eek:)
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top