Skip to main content

Simple Program: Displaying a Line of Text in a Web Page

JavaScript uses notations, javascript may appear strange to non-programmers. We begin by considering a simple script that dispalys the text "Welcome to JavaScript Programming!" in the body of an XHTML document. All major web browsers contains JavaScript interpreters, which process the commands written in JavaScript.

The JavaScript code we write will appear in the <head> section. The browser interprets the contents of the <head> section first, so the JavaScript programs we write there execute before the <body> of the XHTML document displays.

Displaying a Line of Text

<html>
  <head>
    <title>A First Program in JavaScript</title>
    <script type = "text/javascript">
      <!--
      document.writeln( "<h1>Welcome to JavaScript Programming!</h1>" );
      // -->
    </script>
  </head>
  <body>
  </body>
</html>

The <script> tag to indicate to the browser that the text which follows is part of a script. The type attribute specifies the type of file as well as the scripting language used in the script-in this case, a text file written in javascript. Both Internet Explorer and Firefox use JavaScript as the default scripting language.

When a browser that does not support scripts encounters the preceding code, it ignores the <script> and </script> tags and the script code in the XHTML comment. Browers that do support scripting will interpret the JavaScript code as expected.(Some browsers require the JavaScript single-line comment // before the ending XHTML comment delimiter(-->) to interpret the script properly.

Popular posts from this blog

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...

Job Openings at SYNTEL LIMITED :Walk In for Java Professionals : Pune : On 31 January 2015

Company : Syntel Limited Website :  www.syntelinc.com Education/Skills :  JAVA, Springs, Struts, Hibernate, Webservices Experience : 3 – 5 Years Location : Pune / Mumbai / Chennai Syntel (Nasdaq: SYNT) is a leading global provider of integrated information technology and Knowledge Process Outsourcing (KPO) solutions spanning the entire lifecycle of business and information systems and processes. Walk-In Interview For Java Professionals On 31st January 2015 @ Pune Industry Type  :  IT-Software / Software Services Role  :  Software Developer Compensation:     2,00,000 – 5,00,000 P.A Job Description : Minimum 3+ years experience in JAVA, Springs, Struts, Hibernate, Webservices. Minimum 2 years of experience in leading a team Worked in Onsite Offshore Model Proven client interfacing skills Skill Set : Java Yrs of Exp : 3-5 Years Job Location : Pune / Mumbai / Chennai Interview Date :  31st Jan 2015 Interview Location : Pune Venue : Syn...

Tata Steel Recruitment Out : Last date To apply On 12th Jan 2015

Company Name :  Tata Steel Qualification:  Any Graduates,  BE / B.Tech / MCA / M.Sc / MS (B.Sc with min 4 yrs relevant IT experience) Experience:  2 To 10 Yrs Location:  Across India Salary :    As Per Industry Apply Mode:  Online Job Description: Maintain coke cost: Links to plan, coal blend plan & improvement activities. Improvements: Ensure improvement activities like Kaizen, SGA and TPM. Put systems and processes in place. Ensure Tar yield & Co gas yield as per plan: Avoid losses in the system. Plan of coal blend. Optimised operations in batteries. Develop innovative workforce: Professional development of all employees in the operating area of Stamp Charge Batteries. Safety: Deployment of Safety and Occupational Health Policy, Safety Principles, Quality Policy and Environment Policy in Stamp Charge Batteries. Last  Date:  12th Jan 2015 Apply Details :  Click Here