PDA

View Full Version : externally hosted script wont work



tjl
11-22-2005, 08:25 AM
the watermark script wont work it is located here (http://www.dynamicdrive.com/dynamicindex4/logo.htm)

here is the part that is in my body section

<div id="watermarklogo" style="position:absolute;"></div>
<script src="staticlogo.js">
///////////////////////////////////////////////////////////////////
/*Site Logo Script Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com/ */
///////////////////////////////////////////////////////////////////
</script>

and this is the actual code that is uploaded


///////////////////////////////////////////////////////////////////
/*Site Logo Script (Geocities Watermark)
Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and TOS, visit http://www.dynamicdrive.com/ */
///////////////////////////////////////////////////////////////////

//edit the below 5 steps

// 1) substitute 116 and 42 with the width and height of your logo image, respectively
var logowidth=128
var logoheight=128
var logoimage=new Image(logowidth,logoheight)

// 2) change the image path to reflect the path of your logo image
logoimage.src="http://img511.imageshack.us/img511/9881/vgx0ru.jpg"

// 3) Change url below to the target URL of the logo
var logolink="http://s14.invisionfree.com/Video_Game_X/index.php"

// 4) change the alttext variable to reflect the text used for the "alt" attribute of the

image tag
var alttext="Video Game X"

// 5) Finally, below variable determines the duration the logo should be visible after

loading, in seconds. If you'd like the logo to appear for 20 seconds, for example, enter 20.

Entering a value of 0 causes the logo to be perpectually visible.
var visibleduration=10

// Optional parameters
var Hoffset=10 //Enter logo's offset from right edge of window (edit only if you don't like

the default offset)
var Voffset=10 //Enter logo's offset from bottom edge of window (edit only if you don't like

the default offset)


///////////////////////////Do not edit below this line/////////////////////////

var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1

var watermark_obj=ie? document.all.watermarklogo : document.getElementById?

document.getElementById("watermarklogo") : document.watermarklogo

function insertimage(){
if (ie||document.getElementById)
watermark_obj.innerHTML='<a href="'+logolink+'"><img src="'+logoimage.src+'"

width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>'
else if (document.layers){
watermark_obj.document.write('<a href="'+logolink+'"><img src="'+logoimage.src+'"

width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>')
watermark_obj.document.close()
}
}

function positionit(){
var dsocleft=ie? document.body.scrollLeft : pageXOffset
var dsoctop=ie? document.body.scrollTop : pageYOffset
var window_width=ie? document.body.clientWidth : window.innerWidth-20
var window_height=ie? document.body.clientHeight : window.innerHeight

if (ie||document.getElementById){
watermark_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-logowidth-Hoffset
watermark_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
}
else if (document.layers){
watermark_obj.left=dsocleft+window_width-Hoffset-logowidth
watermark_obj.top=dsoctop+window_height-logoheight-Voffset
}
}

function hidewatermark(){
if (document.layers)
watermark_obj.visibility="hide"
else
watermark_obj.style.visibility="hidden"
clearInterval(watermarkinterval)
}

function beingwatermark(){
watermarkinterval=setInterval("positionit()",50)
insertimage()
if (visibleduration!=0)
setTimeout("hidewatermark()",visibleduration*1000)
}

if (ie||document.getElementById||document.layers)
window.onload=beingwatermark



i have a feeling that it is an onload conflict that is in here:

<script type="text/javascript">

/*
Cross browser Marquee script- Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="813px"
//Specify the marquee's height
var marqueeheight="30px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=4
//configure background color:
var marqueebgcolor="#121d2b"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

var marqueecontent='<nobr id="trueWidth"><font face="Alexis"><font size=8><font color="#3eef3a">Welcome to Video Game X forum <a href="mailto:"><font color="red"><b><u>Help spread the word!</u></b></font></a> | | | | | | Today is Monday, November 21st, 2005 (11/21/05) | | | | | | | Want a new font or color in your posts? Make a request in the fonts and colors requests topic in the recent news section and they will be up by the end of the day (hopefully!!!) | | | | | | | I made a logo for the game, check it out and comment at logos section in art | | | | | | | Check out the new pips! | | | | | | | Thanksgiving Break is here! (7 days until school starts again) | | | | | Look at the color of your name and tell me if you like it in the recent news section | | | | | | Want to post something up here? PM an administrator and your announcement will get heard | | | | | Have a great Thanksgiving break everyone!! | | | | | Thank you for visiting Video Game X forum!</font></nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? document.all['trueWidth'].offsetWidth : document.getElementById("trueWidth").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0" align="center"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden;background-color:'+marqueebgcolor+'">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

i know that im not usually supposed to post a question regarding multiple scripts on a single page, but i think i have already diagnosed the problem, so to sum it all up, i just want to make sure that i am right about the problem being the onload command and would like to know how to fix it


any help would be great