My First JavaScript program- To display Welcome message

  Javascript is flexible programming language. It is specially designed for network centric application. Generally, Developer include the java scripting code in client side which interacts the web user and gives the dynamic pages.

Java script has many advantages. Especially, it deals with the immediate response from server and client interactivity. It has lot of interfaces for supporting interactivity.

 Where to include the java script coding??

  Its always use “Script” tags in your html code includes the javascript coding to your program.

 Syntax:

  <Script>

      Code ….

</Script>

 A first program for displaying a welcome message in java script is given below.

First, open a notepad and type the following.

<!DOCTYPE html>

<html>

<head> <Title> This is my first JavaScript program </Title></head>

<body>

<script language= “javascript” >

document.write (“Welcome to the world of java script”)

</script>

</body>

</html>

Save it as “Welcome.html”.

Next, open your browser window. Open the “welcome.html” file in your browser window.



The output shows the message and title of your page.

Sometimes, your browser may not support javascript. It occurs due to the disabling option in scripting.

To enable your java scripting in internet explorer, follow these steps.

In toolsàinternet optionàsecurityàcustom levelàscriptingà enable Active Scriptingà OK

In case of Chrome browser, just open the chrome browser.

In the top right corner, click the settings option. There, choose Show Advanced settings option. Here, choose the following option.

Privacyà content SettingsàJavaScriptà allow all sites to run JavaScript(Recommended)

 

No comments:

Post a Comment