Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

JavaScript Tutorial
JavaScript Introduction
JavaScript How To
JavaScript Where To
JavaScript Variables
JavaScript If...Else Statement
JavaScript Switch Statement
JavaScript Operator
JavaScript Popup-boxes
JavaScript Function
JavaScript For-Loop
JavaScript While-loops
JavaScript Break Loops
JavaScript For..In Statement
JavaScript Event
JavaScript Try-Catch Statement
JavaScript Throw Statement
JavaScript Onerror
JavaScript Spacial Characters
JavaScript Guideline
JavaScript String
JavaScript Date Object
JavaScript Array
JavaScript Boolean Object
JavaScript Math Object
JavaScript HTML DOM Object
JavaScript Browser Detection
JavaScript Cookies
JavaScript Validation
JavaScript Animation
JavaScript Image Maps
JavaScript Timing Event
JavaScript Create Object
JavaScript Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


JavaScript How To...
Previous Next

The HTML <script> tag is used to insert a Java Script into an HTML page.

Example:1

How to write or print the text on a page.

<html>
 <body>
   <script type="text/javascript">
     <!--
     document.write("Vyom Technosoft!")
      //-->
   </script>
 </body>
</html>


Output

  Vyom Technosoft!




Example:2

How to format the text on your page with HTML tags.

<html>
 <body>
   <script type="text/javascript">
     <!--
     document.write("<h4>Vyom Technosoft!<h4>")
      //-->
   </script>
 </body>
</html>


Output

Vyom Technosoft!




Example:3

How to embedded the Java Script on your page with HTML tags.

<html>
 <body>
   <script type="text/javascript">
     <!--
     document.write("<FONT COLOR='RED' SIZE=7>Vyom Technosoft In Red Text</FONT>")
      //-->
   </script>
 </body>
</html>


Output

The word document.write is a standard Java Script command for writing the output to a page.

We start by taking control of the document object, and use its write() method to output some text to the document. The text inside the double quotes is called a String, and this string will be added to the page. Simple, right? To use an object's methods or properties, we write the object's name first, a dot, and then the method or property name.




How to Handle The Older Version Browsers

   <script type="text/javascript">
     <!--
     document.write("<h4>Vyom Technosoft!<h4>")
      //-->
   </script>


Browsers that do not support the Java Script will display the script as page contents. To prevent them from doing this, we can use the HTML comment tag:

The comments around the script code are there so that old browsers that do not understand the script tag won't display the code as a text on the page. Any browser that can do Java Script will disregard the comments. Also note that for Netscape's benefit, the end of the comment is itself commented out using a Java Script comment (two forward-slashes to comment out the rest of the line). This stops errors from occurring in old versions of Netscape.



Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previous Next

Keywords:JavaScript How To


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.