Login | Register | FAQ
Anonymous

problem with my first page javascript

+ Post a reply

14 posts 1, 2


problem with my first page javascript

by Jahehe3 » Mon Sep 24, 2012 12:43 pm

I follow http://html.net/tutorials/javascript/ and saved

<!DOCTYPE html>
<html>
<head>
<title>My first JavaScript page</title>
</head>
<body>

<script type="text/javascript">
//JavaScript code goes here
</script>

</body>
</html>

as "name_page.js" and icon was changed, but
my browser (Mozilla Firefox) only show code of page.
What I do wrong?
User avatar

Jahehe3

  • Posts: 8
  • Joined: Mon Sep 17, 2012 11:41 am

Re: problem with my first page javascript

by XainPro » Mon Sep 24, 2012 6:12 pm

do not paste javascript in your body section add it to your head section of html document.

<!DOCTYPE html>
<html>
<head>
<title>My first JavaScript page</title>
<script type="text/javascript">
//JavaScript code goes here
</script>

</head>
<body>


</body>
</html>
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: problem with my first page javascript

by Jahehe3 » Mon Sep 24, 2012 9:42 pm

lesson-2
<script></script> can by in head, or body.
when I saved file as "name.js", the icon has been changed,
when I clic on this icon, showing error window:
Windows Sript Host
Row: 3
Character: 1
Error: error of syntax
Code: 800A03EA
Source: microsoft JScript - error of compilation

and if I use localhost/name.js in XAMPP, browser shows all code as text editor.
User avatar

Jahehe3

  • Posts: 8
  • Joined: Mon Sep 17, 2012 11:41 am

Re: problem with my first page javascript

by Jahehe3 » Wed Sep 26, 2012 8:58 am

But fuction:
alert('Hello World!');
in <sript></sript> and any another function do not works.
User avatar

Jahehe3

  • Posts: 8
  • Joined: Mon Sep 17, 2012 11:41 am

Re: problem with my first page javascript

by XainPro » Wed Sep 26, 2012 3:03 pm

i think you are talking about this 1
http://html.net/tutorials/javascript/lesson2.php
yes take a deep breath and start over again this time learn step by step and do not skip any step :)
Good luck for your learning !
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: problem with my first page javascript

by unique7 » Wed Jan 22, 2014 5:17 pm

Jahehe3 wrote:I follow http://html.net/tutorials/javascript/ and saved

<!DOCTYPE html>
<html>
<head>
<title>My first JavaScript page</title>
</head>
<body>

<script type="text/javascript">
//JavaScript code goes here
</script>

</body>
</html>

as "name_page.js" and icon was changed, but
my browser (Mozilla Firefox) only show code of page.
What I do wrong?

I'm a noob :D , and I've a same problem.
If you find the answer plz let me know , thank u :)
User avatar

unique7

  • Posts: 5
  • Joined: Wed Jan 22, 2014 5:03 pm

Re: problem with my first page javascript

by unique7 » Wed Jan 22, 2014 5:20 pm

XainPro wrote:i think you are talking about this 1
http://html.net/tutorials/javascript/lesson2.php
yes take a deep breath and start over again this time learn step by step and do not skip any step :)
Good luck for your learning !


I've a same problem and I check the tutorial again , but
my browser (Google Chrome) only show code of page.
plz if you can help me , I'm new here :-/
User avatar

unique7

  • Posts: 5
  • Joined: Wed Jan 22, 2014 5:03 pm

Re: problem with my first page javascript

by unique7 » Wed Jan 22, 2014 10:41 pm

Will someone help me plz
User avatar

unique7

  • Posts: 5
  • Joined: Wed Jan 22, 2014 5:03 pm

Re: problem with my first page javascript

by XainPro » Thu Jan 23, 2014 1:04 pm

are you using mac or windows ?
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: problem with my first page javascript

by unique7 » Thu Jan 23, 2014 7:37 pm

XainPro wrote:are you using mac or windows ?

I'm using windows 7 64-bit
User avatar

unique7

  • Posts: 5
  • Joined: Wed Jan 22, 2014 5:03 pm


+ Post a reply

1, 2