Internet Marketing Forums - Where Great Marketing Ideas Come to Life Internet Marketing Forums - Where Great Marketing Ideas Come to Life

Go Back   Internet Marketing Forums .Net > Internet Marketers' Products and Services > Programming / Scripts
User Name
Password
Register FAQ Members List Classifieds Blog Mark Forums Read

Notices

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2009, 09:25 AM
arbaba's Avatar
Set Avatar
Banned
 
Join Date: Oct 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
arbaba is on a distinguished road
About JavaScript

What is JavaScript?

JavaScript is a compact, object-based scripting language for Web pages. JavaScript code embedded into your HTML pages can enhance them with many interesting elements, from swapping images when you move a cursor over them, to multi-level drop-down menus.

You can create really sophisticated and almost application-like pages with the help of JavaScript. You don't need any special software other than a text editor and a Web browser, and you don't need access to a Web server. You can create and test all your JavaScript code right on your own computer.

JavaScript and Java
Although the names are almost the same, JavaScript isn't the same as Java. These are two different techniques for Internet programming. Java is a real programming language, and you can create real programs with it.

JavaScript is a scripting language. You could even say that JavaScript is rather an extension to HTML than a separate computer language. It's so tightly integrated with HTML that you could call it "JavaScript markup language." JavaScript coders don't care too much about real programming, they just make different nice effects by inserting small JavaScript code fragments into their Web pages.

The drawbacks of JavaScript
Right now the biggest problem is the imperfect JavaScript implementations that today's browsers offer. Although all major browsers that are version 3.0 or higher include JavaScript support, they deal with JavaScript differently.

In fact, different versions of the same browser handle JavaScript differently. This makes it difficult to create a complicated JavaScript code that work across all browsers. So always check your pages on as many different browsers (and even platforms) as possible.

What do JavaScript code look like?
Like HTML, JavaScript is just text that can be typed into a text editor. Its code is embedded in HTML within a <SCRIPT> tag. Some old browsers don't understand this tag. To prevent them from treating your JavaScript as HTML, always use this trick involving HTML comments...

Code:
<script type="text/javascript">
<!-- hide JavaScript code from old browsers
YOUR SCRIPT HERE
// end the hiding comment -->
</script>


Here's an example of JavaScript code that prints current date in the top right corner of your Web page...
Code:
<html>
<head>
<script type="text/javascript">
<!--
function PrintDate() {
today = new Date();
document.write('Date: ', today.getMonth()+1, '/', today.getDate(), '/', today.getYear());
}
//-->
</script>
</head>

<body>
<p align="right">
<script type="text/javascript">
<!--
PrintDate();
//-->
</script>
</p>
THE REST OF YOUR PAGE.
</body>
</html>



The power of JavaScript
JavaScript has one particular feature that makes it an interactive and power tool - event handling. You can trigger the JavaScript program by various events. For example, when the page loads, when it quits, when you pass your cursor over a link, or when you click on a button or a link.

Here's a list of the common event handlers, that all popular browsers can deal with...

Event When it's triggered
onAbort An image is stopped from loading because the user either hits Stop or leaves the page.
onBlur An element, such as a window, frame, or form field, loses focus; that is, when the user clicks on something else.
onClick The user clicks on the particular element.
onChange The value of a form field changes, for example, when the user types in some data.
onDblClick The user double-clicks on the particular element.
onError A loading error happens, like a missing image.
onFocus The user puts the focus on the target element, by clicking on it or tabbing to it.
onKeyDown A key on the keyboard is pushed down, regardless of whether it's then held down or released.
onKeyPress This event is repeatedly triggered as long as a key is held down.
onKeyUp A key on the keyboard is released.
onLoad The browser completely loads the page.
onMouseDown A key on the mouse is pushed down, regardless of whether it's then held down or released.
onMouseMove The mouse moves.
onMouseOut The pointer moves out of the target area.
onMouseOver The pointer moves over the target element.
onMouseUp A key on the mouse is released.
onReset The Reset button of a form is clicked.
onResize A window or frame is resized by the user.
onSelect The user highlights text in a form field.
onSubmit A form is submitted.
onUnload The user leaves the page.

The basic event handling syntax is very simple. The following JavaScript code will pop up a window when you click a button...

Code:
<form>
<input type="button" value="Click me" onClick="alert('This is JavaScript!');">
</form>


If you need an elaborate action to take place when the button is clicked, you can call a predefined function. The following JavaScript code writes text to the statusbar (the bar on the bottom of your browser where the URLs are shown)...

Code:
function MyFunc( txt ) {
window.status = txt;
}
<form>
<input type="button" value="Click me" onClick="MyFunc('This is JavaScript!');">
</form>


bratz baby fish tank
Photos Tutorial

Last edited by arbaba; 11-04-2009 at 03:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-10-2010, 03:12 PM
YAT22's Avatar
Set Avatar
Distinguished Member
 
Join Date: Mar 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
YAT22 is on a distinguished road
Thanks for the information, dude
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-17-2010, 05:07 PM
Blue Dragon's Avatar
Set Avatar
Distinguished Member
 
Join Date: Feb 2010
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Blue Dragon is on a distinguished road
Thanks for this tutorial like post.. I really like to learn more about javascript.. more possibilities are waiting..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-28-2010, 04:53 AM
abeltenny0210's Avatar
Set Avatar
Junior Member
 
Join Date: May 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
abeltenny0210 is on a distinguished road
I get what I need. Thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
Usefull JavaScripts JavaScriptBank Programming / Scripts 4 06-09-2010 06:52 PM
Good and Nice JavaScripts JavaScriptBank Programming / Scripts 0 09-21-2009 06:03 AM



All times are GMT -5. The time now is 05:00 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Internet Marketing ForumsAd Management by RedTyger

Internet Marketing News | Prospect Response
Hosted By Server Yard

Internet Marketing Forums - Bringing Internet Marketing Ideas to Reality Internet Marketing Forums - Bringing Internet Marketing Ideas to Reality Internet Marketing Forums - Bringing Internet Marketing Ideas to Reality

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19