Geeks Talk

Prepare for your Next Interview




How to use JavaScript in HTML page

This is a discussion on How to use JavaScript in HTML page within the JavaScript forums, part of the Web Development category; How to use JavaScript in HTML page In this JavaScript tutorial you will learn how to use JavaScript in HTML page, how to write output to a page, different places ...


Go Back   Geeks Talk > Web Development > JavaScript

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-20-2007
Moderator
 
Join Date: Oct 2005
Posts: 720
Thanks: 1
Thanked 99 Times in 74 Posts
Lokesh M is on a distinguished roadLokesh M is on a distinguished road
How to use JavaScript in HTML page

How to use JavaScript in HTML page

In this JavaScript tutorial you will learn how to use JavaScript in HTML page, how to write output to a page, different places where JavaScript can be paced in HTML, JavaScript in external file and how to place and execute JavaScript in external file.

Read More...
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-13-2007
Contributing Member
 
Join Date: May 2007
Location: bangalore
Posts: 65
Thanks: 3
Thanked 8 Times in 6 Posts
hari.nattuva is on a distinguished road
Re: How to use JavaScript in HTML page

Hi,

just create a .js file using notepad editor i mean javascript function u bind the javascript file in html using script tag 'src' attribute like


Ex:

Example.js
----------

function f1(t)
{
if (t.value=' '){
alert('Text Box shold not be empty')
}
}

Example.html
-------------












when ever u click the button it will call the js file f1 funtion it will verify the text box data if it empty it will give the alert message if not nothing will happen.

do u have any quries let me know......

Regards,
Hari Prasad

Last edited by hari.nattuva : 06-13-2007 at 10:36 AM.
Reply With Quote
The Following User Says Thank You to hari.nattuva For This Useful Post:
  #3 (permalink)  
Old 07-20-2007
Expert Member
 
Join Date: Jul 2007
Location: Kolkata
Posts: 110
Thanks: 6
Thanked 8 Times in 8 Posts
animesh.chatterjee is on a distinguished road
Re: How to use JavaScript in HTML page

correct you can use the javascript anywhere of the page
Reply With Quote
  #4 (permalink)  
Old 07-20-2007
Expert Member
 
Join Date: Jul 2007
Location: Kolkata
Posts: 110
Thanks: 6
Thanked 8 Times in 8 Posts
animesh.chatterjee is on a distinguished road
Re: How to use JavaScript in HTML page





Reply With Quote
  #5 (permalink)  
Old 07-20-2007
Expert Member
 
Join Date: Jul 2007
Location: Kolkata
Posts: 110
Thanks: 6
Thanked 8 Times in 8 Posts
animesh.chatterjee is on a distinguished road
Re: How to use JavaScript in HTML page

How to Handle Older Browsers
Browsers that do not support JavaScript will display the script as page content. To prevent them from doing this, we may use the HTML comment tag:



The two forward slashes at the end of comment line (//) are a JavaScript comment symbol. This prevents the JavaScript compiler from compiling the line.
Reply With Quote
  #6 (permalink)  
Old 07-20-2007
Expert Member
 
Join Date: Jul 2007
Location: Kolkata
Posts: 110
Thanks: 6
Thanked 8 Times in 8 Posts
animesh.chatterjee is on a distinguished road
Re: How to use JavaScript in HTML page

With traditional programming languages, like C++ and Java, each code statement has to end with a semicolon.

Many programmers continue this habit when writing JavaScript, but in general, semicolons are optional! However, semicolons are required if you want to put more than one statement on a single line.
Reply With Quote
Reply

  Geeks Talk > Web Development > JavaScript


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Convert PDF to HTML with IntraPDF's PDF to HTML converter and reach widest audience! JobHelper Geeks Lounge 0 04-08-2007 05:03 AM
any limitation in javascript? psuresh1982 JavaScript 3 04-04-2007 09:05 AM
JavaScript Tutorials admin JavaScript 2 03-22-2007 08:17 PM
refresh the page using javascript... psuresh1982 JavaScript 5 02-03-2007 08:36 AM
PHP Code to email HTML Page along with PDF Attachment Shivanna PHP 0 10-11-2006 05:57 AM


All times are GMT -4. The time now is 12:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved