Syntax error on first line (import)

Discussion in 'JavaScript' started by solone, Jul 20, 2007.

  1. #1
    I hope somebody can help - this has been driving me crazy. I have a simple .js file that looks like this:

    import System;
    import System;
    import System.IO;
    import System.Windows.Forms;

    var x = 13;



    I'm getting a Syntax error at Line 1, Char 1. What is wrong with the import statements?
     
    solone, Jul 20, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You don't need those import sentences.
    And check the way you refer your .js file on your .html file. Should be something like this inside your <head> section:

    <script src="../js/yourFile.js" language="JavaScript" type="text/javascript"></script>
     
    ajsa52, Jul 21, 2007 IP
  3. mgware

    mgware Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You are confusing Java with Javascript :D
     
    mgware, Jul 21, 2007 IP