Javascript Questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JimmyStephans
    Confirmed User
    • Mar 2003
    • 560

    #1

    Javascript Questions

    I just had some new pages done for TrueBabes that includes some JS

    The designer includes the script like this

    <script type="text/javascript" src="images/scripts/tb.js"></script>

    I would rather the JS be in the head of the HTML file so that pages moved to sub-directories with ease.

    How would I do that?

    The code is:

    ?// JScript File
    function onmenubuttonover(cb,nm)
    {
    if(cb==null){return;}
    cb.src="images/common/" + nm+"_hl.jpg";
    }

    function onmenubuttonout(cb,nm)
    {
    if(cb==null){return;}
    cb.src="images/common/" + nm+".jpg";
    }

    function onclientbuttonover(cb,num,nm)
    {
    if(cb==null){return;}
    cb.src="images/" + num + "/" + nm+"_hl.jpg";
    }

    function onclientbuttonout(cb,num,nm)
    {
    if(cb==null){return;}
    cb.src="images/" + num + "/" + nm+".jpg";
    }

    So, basically how do I place that is the head of the HTML?

    Thanks in advance
    http://TrueBabes.com/
  • AdultSoftwareSolutions
    Confirmed User
    • Mar 2009
    • 193

    #2
    I would rather the JS be in the head of the HTML file so that pages moved to sub-directories with ease.
    huh? What does this mean? If you want it in the head, put it in the head. Just make sure it doesn't do anything that requires the page to be loaded first though.
    Adult Software Solutions (ICQ 559884738)
    PHP, MySQL, Flash, Actionscript, Java, Wowza, CMS, Tube, VOD, CRM, Dating, Social Networks, Paysites, TGPs, Directories and more.
    If you can think it I can build it.

    Comment

    • sexuallyhealed
      So Fucking Banned
      • Sep 2005
      • 532

      #3
      no clue..

      Comment

      • cyco_cc
        Confirmed User
        • Oct 2008
        • 344

        #4
        If you want the javascript to be inline (not including an external file), it would look like this:

        Code:
        <script language="javascript" type="text/javascript">
        // Your code
        </script>
        However, you should just include it in your header. It's the exact same thing as putting it inline.

        Comment

        • JimmyStephans
          Confirmed User
          • Mar 2003
          • 560

          #5
          Thanks, I get it now.
          http://TrueBabes.com/

          Comment

          Working...