Jump to content

Compiler Error

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 298 posts
Hello All,

I am completely new to JavaScript (less the fact I have the PHP Development Kit from Eclipse). I was doing the tutorial in JavaScript tutorials called JavaScript Hello World Output.

The code provided goes as follows:


[U][SIZE=2]<script
[/SIZE][/U][SIZE=2][LEFT]type=[/LEFT]
[/SIZE][LEFT][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"text/javascript"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]>[/SIZE]
[LEFT][SIZE=2]document.write([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Hello World"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE][/LEFT]
[SIZE=2][U]<[/U]/script>[/SIZE]

The underlined words are the errors Eclipse is coming up with. Need Help.

Thank You.
[/LEFT]

Edited by Hunter100, 29 March 2010 - 11:17 PM.
Typo


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Did you try loading your file in a browser? Javascript is not compiled.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 298 posts
Oh, well I didn't load it I would've if I knew that and knew how to.

So, how do you?

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
JavaScript is almost always part of a web page (a .html file). Just double click on the .html file and it should load.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
cdg10620

cdg10620

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 389 posts
Take the code below. Place it in a file and save it as test.html. Then open it in your web browser. It should work.

<html>
<body>

<script type="text/javascript">
document.write("Hello World!");
</script>

</body>
</html> 

-CDG10620
Software Developer