1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

JavaScript glitching (I'm newb)

Discussion in 'Software Development' started by jelleym, Oct 7, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    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. ;)

     
  2. scmazter

    scmazter

    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?
     
  3. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    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?
     
  4. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
  5. scmazter

    scmazter

    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.
     
  6. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    OK here's the link & the screenshot is coming up:

    http://www.gamerforum.vze.com/ (but to see the clickable smilies you have to register, login & respond to message.
     
  7. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    Pumpkin smilies:
     

    Attached Files:

  8. scmazter

    scmazter

    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.
     
  9. Gibble

    Gibble

    Joined:
    Oct 9, 2001
    Messages:
    27,087
    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 :)
     
  10. Gibble

    Gibble

    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 :)
     
  11. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    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.
     
  12. Gibble

    Gibble

    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.
     
  13. Gibble

    Gibble

    Joined:
    Oct 9, 2001
    Messages:
    27,087
    So where's the link to your page, so I can see what you have done differently?
     
  14. scmazter

    scmazter

    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.
     
  15. jelleym

    jelleym Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    634
    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>
    
     
  16. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/170092

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice