BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
JavaScript
JavaScript Guidelines
Stock sorter example for IE5
Confused about how to use a data island in IE5??
Software Release tracking application
Employee Phonebook dataisland
Multitab DHTML browser
Trim function in Javascript
Multiple Grid
Re: Trim Function in JavaScript
Re: Trim Function in JavaScript
Trim Function in JavaScript using Regular Expressions.
DHTML ScoreBoard Behavior
Re: JScript Super Class To Handle XML Transformations
Updated: Detect XML Parser version using Javascript
XML Cache using IE 5.0 Behaviour
XML cache on client for the desktop application website
Javascript XML element listing
Sorting Data Islands by clicking on the column header (using behaviors).
Simple JS Menu Tree using XSLT
xml report writer
 
LAMP >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :2511

 

How to use JavaScript?

Introduction

JavaScript can be used either directly in the HTML page or in a separate file. The file should then get the .js extension. If you are using it in a HTML then you will need to include the <script> tag and if you are using a separate file, then you don’t need this tag. Usually the <script> tag is used in the <head> tag but you can insert it wherever you want. However it is recommend leaving it in the <head> tag. That way your code will be differentiated from the HTML code and furthermore your HTML page will be easier to read and understand. The <script> tag takes an attribute called “type”. This attribute can be used to define the scripting language – in our case it will be “JavaScript”. You can also use the “language” attribute to define the scripting language. However this attribute is deprecated and it is recommend using the type attribute. You can include any amount of <script> tags.

Example (from HTML)

<html>

<head>

<script type="text/javascript">

            document.write("This is from inline HTML code.")

</script>

</head>

<body></body>

</html>

Output

Example (From a separate file)

<html>

<head>

<script type="text/javascript">

            document.write("This is from inline HTML code.<br>")

</script>

<script src="javascript_usage_example_from_jsfile.js"></script>

</head>

<body></body>

</html>

Example (javascript_usage_example_from_jsfile.js)

document.write("This is from the external file.")

Output


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

View all Jobs (Add yours)
View all CV (Add yours)




swimming pool contractor
chicago web site design
teleconferencing services
Web Hosting
online fax service
Calvin klein sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP