Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Basics

5,409 views

Published on

  • Be the first to comment

  • Be the first to like this

Basics

  1. 1. Javascript coding:basics *With javascript code, we must place it inside <script> </script> so it will work. We will use dreamweaver as a code editor instead of notepad as this will help us see things in different colours making it easier to code. Create a folder on desktop for this activity. Copy the following code into dreamweaver-<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html>
  2. 2. We now add a javascipt command, update the code and save it as program1.html and run on google chrome. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> <Script> Alert(“hello,world”); </script> </head> <body> </body> </html>
  3. 3. Activity 1  Create 3 alerts on the webpage using the code.
  4. 4. We can save the javascript code into it's own format known as .js So create a new page on dreamweaver and enter only- alert(“hello, students”); then save as helloworld.js
  5. 5. Now enter this code in a new html document and save as program2.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <script src="helloworld.js"></script> </body> </html>
  6. 6. Go back to the .js file and enter another alert command alert(“hello, Teacher”); *save and test it on google chrome.

×