Tuesday, April 30, 2013

HELLO WORLD IN "JAVASCRIPT"


Javascript is client side scripting used to design dynamic webpages. Unlike PHP which require a server to execute it run on browser itself.Javascript can be used with html to produce dynamic web pages. It can be inserted into <head> tag or <body> tag.Javascript also follow Object Oriented Programming .Here is our helloworld.html using javascript.Open notepad paste the code and save it as hello.html.

<html>
<head>
<title>helloworld with JS
</title>
</head>
<body>
<script type="text/javascript">
document.write("hello world");
</script>
</body>
</html>  

Explaining the code:

<script type="text/javascript"> tells the browser that next lines are JavaScript be ready.
document.write() document is the class and write() is the function that is used to display the object on the page.
</script> tell the browser that javscript ended.

No comments:

Post a Comment