hi want to learn javascript and i'm using ubuntu 9.04.i have google chrome and fire fox with enabled javascript.
All things are good but when i write a js file and open it in browser but nothing happening
html code loads but js not any hint why .

You can not open a .js file in your browser. You need to link it to a HTML file by using:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My first page with JavaScript</title>
<script type='text/javascript' src='scripts/MyScript.js'></script>
</head>
<body>
</body>
</html>

Or write the code into the HTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My first page with JavaScript</title>
<script type='text/javascript'>
alert("This is some JavaScript code!");
</script>
</head>
<body>
</body>
</html>

~G

okaaa now its working ;->>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.