Results 1 to 2 of 2

Thread: help separating it into a .js file

  1. #1
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default help separating it into a .js file

    ok so im trying to separate out my code to make it easier to edit, since I use the same code through multiple pages, I have the style.css sheet down pat, and I header somewhere that you could use a .js page to display additional information in the same page, well my problem is, I don't know .js too well, im still learning,
    so without putting my style sheet on here, how would I go about altering this page to link my links to a .js file or two?

    Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <title>Big Business 2.0 by FCT</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    
    <body>
    <div id="logo">
      <a href="home.html"><img src="img.png" border="0"></a>
    </div>
    <div id="banner">
      <img src="http://i44.photobucket.com/albums/f11/master-of-time/Cox/newbanner.jpg">
    </div>
    <div id="clock">
      <iframe src="http://free.timeanddate.com/clock/i35x3s8s/n127/fn6/fs16/fc9ff/tct/pct/tt0/th2/tb1" frameborder="0" width="357" height="24" allowTransparency="true"></iframe>
    </div>
    <div id="digi">
      <a href="sub/google.html"><img src="digi.png" border="0"></a>
    </div>
    <div id="home">
      <a href="home.html"><font size="5" >Home</font></a>
    </div>
      
    <div id="links">  
      <ul>
        <li>Codes
          <ul>
            <li><a href=".html">left link1</a></li>
            <li><a href=".html">left link2</a></li>
            <li><a href=".html">left link3</a></li>
            <li><a href=".html">left link4</a></li>
            <li><a href=".html">left link5</a></li>
            <li><a href=".html">left link6</a></li>
          </ul>
        </li>
        <li>Installs
          <ul>
            <li><a href=".html">left link7</a></li>
            <li><a href=".html">left link8</a></li>
            <li><a href=".html">left link9</a></li>
          </ul>
        </li>
      <br />
        <li>Trouble Shooting
          <ul>
            <li><a href=".html">left link10</a></li>
            <li><a href=".html">left link11</a></li>
            <li><a href=".html">left link12</a></li>
          </ul>
        </li>
      </ul>
    </div>
    <div id="links2">  
      <ul>
        <li>Other Information
          <ul>
            <li><a href=".html">right link1</a></li>
            <li><a href=".html">right link2</a></li>
            <li><a href=".html">right link3</a></li>
            <li><a href=".html">right link4</a></li>
            <li><a href=".html">right link5</a></li>
          </ul>
        </li>
      </ul>
    </div>
        
    <div id="egg">
      <a href="easteregg.html"><img src="http://i44.photobucket.com/albums/f11/master-of-time/Cox/egg.jpg" border="0"></a>
    </div>
      
    </body>
    </html>

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    If I'm right, you're trying to make a reference to an external JavaScript script. This is just basically the same as you did with the CSS, except it is:
    Code:
    <script type="text/javascript" src="filename.js">
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •