#1
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2004
    Posts
    33
    Rep Power
    13

    Question External .js file


    Hey,

    I am using a script mmLoadMenus that was put together for us by our designer.

    Right now, it is referenced and called as shown below

    Code:
    <!--#include virtual="/inserts/flyout.asp" -->
    <script language="JavaScript1.2" type="text/javascript" src="/inserts/mm_menu.js"></script>
    <script language="Javascript" type="text/javascript" src="/inserts/js_functions.js"></script>
    </head>
    <body>
    <script language="JavaScript1.2" type="text/javascript">mmLoadMenus();</script>
    Our SEO would like it to no longer be an inline element, putting the javascript function into an external .js file and calling it like the others.

    However, when I do that, I get an error telling me "Object Expected" on the line that calls the mmLoadMenus();

    Code:
    <script language="JavaScript1.2" type="text/javascript" src="/inserts/flyout.js"></script>
    <script language="Javascript" type="text/javascript" src="/inserts/js_functions.js"></script>
    <script language="JavaScript1.2" type="text/javascript" src="/inserts/mm_menu.js"></script>
    </head>
    <body>
    <script language="JavaScript1.2" type="text/javascript">mmLoadMenus();</script>
    Any ideas would be much appreciated.

    Thanks,

    Scott
  2. #2
  3. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2924
    change this:
    Code:
    <script language="JavaScript1.2" type="text/javascript" src="/inserts/flyout.js"></script>
    to this:
    Code:
    <script language="JavaScript1.2" type="text/javascript" src="/inserts/flyout.asp"></script>
    the .js is not joker, the server won't look for .asp all by itself.

    also, in the flyout.asp file remove the <script> and </script>
    as you no longer need them in there.

Similar Threads

  1. Replies: 0
    Last Post: September 28th, 2006, 11:03 AM
  2. Replies: 3
    Last Post: September 12th, 2006, 02:35 AM
  3. Can vb6 load external function ( such as from text file) ?
    By udom in forum Visual Basic Programming
    Replies: 2
    Last Post: July 6th, 2006, 03:10 AM
  4. Forms and an external html file, the perfect marriage
    By Khrysller in forum HTML, JavaScript And CSS Help
    Replies: 7
    Last Post: June 14th, 2005, 02:31 AM
  5. How to Save Edited HTML File to External Website
    By xxist in forum ASP Development
    Replies: 1
    Last Post: March 19th, 2003, 12:59 AM

IMN logo majestic logo threadwatch logo seochat tools logo