Skip to main content

Dynamic Welcome Page in JavaScript

To create a dynamic welcome page that obtains the  user's name, then diplays it on the page. The script uses another predefined dialog box from window object(a prompt dialog) which allows the user to input a value that the script can use. The program asks the user to input a name, then displays the name in the XHTML document.

<html>
  <head>
    <title>Using Prompt and Alert Boxes</title>
    <script type = "text/javascript">
      <!--
      var name; //string entered by the user
   
      name = window.prompt( "Please enter your name" );
   
      document.writeln( "<h1> Hello, " + name + ",
              welcome to JavaScript programming!</h1>" );
      // -->
    </script>
  </head>
  <body>
    <p>Click Refresh to run this script again.</p>
  </body>
</html>

A declaration that contains the JavaScript keyword var. Keywords are words that have special meaning in JavaScript. The keyword var at the beginning of the statement indicates that the word name is a variable. A variable is a location in the computer's memory where a value can be stored for use by a program.

Popular posts from this blog

Displaying Text in an Alert Dialog

In JavaScript we can display information in windows called dialogs (or dialog boxes) that "pop up" on the screen to grab the user's attention. Dialogs typically diplay important messages to users browing the web page. JavaScript allows you easily to display a dialog box containing a message. The following program displays Welcome to JavaScript Programming! as three lines in a predefined dialog called an alert dialog. Alert dialog box displaying multiple lines. <html>   <head>     <title>Printing Multiple Lines in Dialog Box</title>     <script type = "text/javascript">       <!--       window.alert( "Welcome to \n JavaScript\nProgramming!" );       // -->     </script>   </head>   <body>     <p>Click Refresh to run this script again.</p>   </body> </html> The script user the browser's ...

Introduction to Search engine optimization (SEO)

Search engine optimization (SEO) is the way of visibility of a website or a web page in a search engine's "natural" or un-paid ("organic") search results(Google, Bing, Yahoo etc). SEO may target different kinds of search algarithm, including image search, video search, local search, academic search, news search and industry-specific vertical search engines.

List of software companies in Chennai

List of software companies in Chennai India's Information technology is an industry consisting of IT services and business process outsourcing(BPO). In india information technology is playing an important role, IT sector in India is generating more than 3 million employment. IT & ITeS industry in India has grown enormously. Indian Information Technology has made a mark in the world. Many MNC's are started branches in Indian cities like Bangalore, Chennai, Delhi etc,. The below table shows you list of software companies in Chennai. 4i Apps Solutions Pvt Ltd http://www.4iapps.com Abra Technologies http://www.abratechnologies.com Accel Frontline Ltd http://www.accelfrontline.in Adrenalin eSystems Ltd http://www.myadrenalin.com Akmin Technologies Pvt Ltd http://www.akmin.com American Megatrends India Pvt Ltd http://www.amiindia.co.in Anantara Solutions Pvt Ltd http://www.anantsol.com Arrowpoint Technologies Pvt Ltd http://www.arrowpointtechn...