JavaScript glitching (I'm newb)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jelleym

Thread Starter
Joined
Sep 6, 2001
Messages
635
Any JavaScript experts here?

If so, maybe you can advise why my insertion of the below JavaScript into my board's script is failing to change the cheesy smilie to my cool smilie?

Note that I inserted the Javascript exactly as per below (except for the URL names). I had also tried placing it right after the HEAD tag. But nothing seems to work. What have I done wrong?

I'm not a programmer, so please respond as if to an eight-year old. Thanks. ;)

<HTML>
<HEAD>
<TITLE><xxxboard title></TITLE>

<script language="JavaScript">
for(i=0 ; i<document.images.length ; i++){
if(document.images.src=="http://images.xxxboard.com/themes/yabbse/cheesy.gif"){
document.images.src="http://www.imagehost.com/client/janedoe/cool.gif"
}
}
</script>
 
Joined
Oct 5, 2003
Messages
557
Yep, I consider myself a javascript xpert, however I'm not quite sure that you're trying to do - which of the following:
#1: Are you trying to have the smily constantry changing from one to the other?
#2: Do you want it to change when the mouse appears over it?
 

jelleym

Thread Starter
Joined
Sep 6, 2001
Messages
635
Originally posted by scmazter:
Yep, I consider myself a javascript xpert, however I'm not quite sure that you're trying to do - which of the following:
#1: Are you trying to have the smily constantry changing from one to the other?
#2: Do you want it to change when the mouse appears over it?
The answer is neither. I'm merely seeking to change te original board smilies to my own [clickable] smilies. Since a picture is worth 1000, I'm attaching a screenshot below, of TheGamer forums wherein he switched all the original yellow smilies of the YABB forums into orange pumpkins, via that javascript - except of course he repeated that code 16 times [with variation] to achieve the 16 pumpkins.

My problem is, that when I asked him:
"where exactly did you insert the code within the board's script?" he responded "in between the and" (whatever that means).

So maybe you can advise me where I'm supposed to place that code so that it should work on my board as well?
 
Joined
Oct 5, 2003
Messages
557
AHhh I still don't get a lot of this. I THINK I have an idea of what you want. For one, I can't see no screenshot, for another mabye u can gime a link to the forums.
 
Joined
Oct 5, 2003
Messages
557
Ahh I registered, now what?
U know hwat would be simpler? If you just want to customise your imagies on your forum, use these free forums, proboards they're great and u can customise everything in the admin panel.
 
Joined
Oct 9, 2001
Messages
27,087
Originally posted by jelleym:
Any JavaScript experts here?

If so, maybe you can advise why my insertion of the below JavaScript into my board's script is failing to change the cheesy smilie to my cool smilie?

Note that I inserted the Javascript exactly as per below (except for the URL names). I had also tried placing it right after the HEAD tag. But nothing seems to work. What have I done wrong?

I'm not a programmer, so please respond as if to an eight-year old. Thanks. ;)
Put your script at the bottom of the page, because the page isn't done loading when the script executes, it sees no images to change, then the page finishes loading the graphics you don't want.

Or at least that's my guess as to what's happening :)
 
Joined
Oct 9, 2001
Messages
27,087
Yep, that's whats happening, move the script to the end of your document, right before the closing < /html > tag

Then it should work :)
 

jelleym

Thread Starter
Joined
Sep 6, 2001
Messages
635
Originally posted by Gibble:
Yep, that's whats happening, move the script to the end of your document, right before the closing < /html > tag

Then it should work :)
Nope. It isn't working. I even copy/pasted TheGamer's exact pumpkin code for all of the pumpkin smilies, and I pasted it right before the closing HTML of my board script. But no dice.
 
Joined
Oct 9, 2001
Messages
27,087
Woah...wow...

I'm too drunk to help you now, but if I don't respond withing 12 hours, PM me and I'll come back to this thread...

...damn I just reread this about 8 times correcting spelling and grammar...I hope it's readable now.
 
Joined
Oct 5, 2003
Messages
557
How come I still don't understand wat ze hell u're trying to do.

If you just want to change the smiles on your board, when some2 posts a message, well u should be able 2 do that in the options.
If you want to put that script on a page, well that script makes no sence at all so that is y it aint working. Tell me what you want the script to do and I'll make one for u.
 

jelleym

Thread Starter
Joined
Sep 6, 2001
Messages
635
Originally posted by Gibble:
So where's the link to your page, so I can see what you have done differently?
Well, Gibble, here's basically the script:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>

<TITLE><bn title></TITLE>

<style type="text/css">

A:link {COLOR: #6d4f38; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline}

A:visited {COLOR: #6d4f38; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline}

A:hover {COLOR: #be7758; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none}



.nav  {color: #6d4f38; text-decoration: none; background-color: transparent}

.nav:link {COLOR: #6d4f38; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline}

.nav:visited {COLOR: #6d4f38; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline}

.nav:hover {FONT-WEIGHT: bold; COLOR: #be7758; BACKGROUND-COLOR: transparent; TEXT-DECORATION: none}



BODY {FONT-SIZE: 13px; FONT-FAMILY: Verdana, arial, helvetica, serif}

TABLE {empty-cells: show}

TD {FONT-SIZE: 13px; COLOR: #804000; FONT-FAMILY: Verdana, arial, helvetica, serif}

input, textarea, select { color: #804000; font: 8pt verdana; font-weight: none; text-decoration: none; background: white; border-width: .1em; border-style: solid; border-color: gainsboro}


SELECT {FONT-SIZE: 7pt; COLOR: #804000; FONT-FAMILY: Verdana,arial, helvetica, serif}


.windowbg {background-color: whitesmoke; font-size: 13px; font-family: Verdana, arial, helvetica, serif; color: "#804000";}

.windowbg2 {background-color: whitesmoke; font-size: 13px; font-family: Verdana, arial, helvetica, serif; color: "#804000";}

.windowbg3 {background-color: gainsboro; font-size: 13px; font-family: Verdana, arial, helvetica, serif; color: "#804000";}


.hr {COLOR: #804000; BACKGROUND-COLOR: transparent}

.titlebg {COLOR: "#804000"; BACKGROUND-COLOR: silver}

.text1 {FONT-WEIGHT: bold; FONT-SIZE: 13px; COLOR: #804000; FONT-STYLE: normal; BACKGROUND-COLOR: transparent}

.catbg {FONT-WEIGHT: bold; FONT-SIZE: 13px; COLOR: #804000; BACKGROUND-COLOR: gainsboro}

.bordercolor {FONT-SIZE: 13px; COLOR: #804000; FONT-FAMILY: Verdana, arial, helvetica, serif; BACKGROUND-COLOR: #804000}

.quote {FONT-SIZE: 10px; COLOR: #804000; FONT-FAMILY: Arial, verdana, helvetica, serif; background: white; border-width: .1em; border-style: solid; border-color: gainsboro}

.code {FONT-SIZE: 10px; COLOR: #804000; FONT-FAMILY: Courier New, helvetica, Times New Roman, serif; BACKGROUND-COLOR: #cccccc}

.help {CURSOR: help; BACKGROUND-COLOR: transparent}

.meaction {COLOR: #be7758; BACKGROUND-COLOR: transparent}



.admin_color {COLOR: #be7758;}

.gmod_color {COLOR: #be7758;}

.mem_color {COLOR: #be7758;}

</style>

<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<META content="<bn title>" name=description>
<META content="Boardnation forum" name=keywords>
<META content="MSHTML 6.00.2600.0" name=GENERATOR>

</HEAD>

<BODY>
</BODY>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/smiley.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/smiley.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/wink.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/wink.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/cheesy.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/laugh.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/grin.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/grin.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/angry.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/angry.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/sad.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/sad.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/shocked.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/shocked.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/cool.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/cool.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/huh.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/huh.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/rolleyes.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/rolleyes.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/tongue.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/tongue.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/embarassed.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/embarassed.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/lipsrsealed.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/lipsrsealed.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/undecided.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/undecided.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/kiss.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/kiss.gif" 
}
}
</script>

<script language="JavaScript"> 
for(i=0 ; i<document.images.length ; i++){
if(document.images[i].src=="http://images.boardnation.com/themes/silver/cry.gif"){
document.images[i].src="http://www.penthesilea.ch/yabb-smiley-sets/halloween-pumpkins/cry.gif" 
}
}
</script> 

</HTML>
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top