function in .js

Discussion in 'JavaScript' started by gvm, Sep 19, 2006.

  1. #1
    This is not working. Any ideas?

    <script src="/scripts/moreLinks.js" type="text/javascript"></script> is placed in html head or body to call function in moreLinks.js file with these tags only

    <script language="javascript">

    function links() {

    window.alert("You did it!")

    }
    </script>

    Thanks,
     
    gvm, Sep 19, 2006 IP
  2. gvm

    gvm Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This works:
    <script src="/scripts/moreLinks.js" type="text/javascript"></script>



    Placed in body:
    <script language="javascript" >
    links();
    </script>
     
    gvm, Sep 19, 2006 IP
  3. discoverclips

    discoverclips Peon

    Messages:
    491
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you could use <body onload="links()"> as well
     
    discoverclips, Sep 19, 2006 IP
  4. gvm

    gvm Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the info...I need all I can get.:)
     
    gvm, Sep 19, 2006 IP