Format of a JavaScript code


October 24, 2008   Javascript — Tags: , , — 52coding   

JavaScript statements terminate with a semicolon, though not all statements need the terminator expressly given. If the JavaScript engine determines that a statement is complete (whatever that is for each type of statement), and the line ends with a new line character, the semicolon can be omitted:

What JavaScript Can’t Do


October 24, 2008   Javascript — Tags: — 52coding   

JavaScript is a client-side language; that is, it is designed to do its work on your machine, not on the server. Because of this, JavaScript has some limitations built-in, mostly for security reasons:

Where JavaScript Came From


October 24, 2008   Javascript — Tags: — 52coding   

If JavaScript isn’t related to Java, then why do they have such similar names? It’s another example of one of the computer industry’s most annoying traits: the triumph of marketing over substance.

When Netscape added some basic scripting abilities to its Navigator Web browser, it originally called that scripting language LiveScript. Around the same time, Java was getting lots of press as the Next Big Thing In Computing.

javascript get the mouse position


September 10, 2008   Javascript — Tags: , , — 52coding   

javascript get the mouse position. Demo

javascript tips window,pop-up window


September 10, 2008   Javascript — Tags: , , , — 52coding   

javascript pop-up window.Demo

In JavaScript, forms are accessed through the DOM via the document object using a couple of different approaches. The first is to access the form using the forms property on document. Forms are just one of the many page elements collected in arrays. If the page only has one form, access it at the array index zero (0):

A JavaScript array is an object, just like String or Math. As such, it’s created with a constructor:

var newArray = new Array(’one’,'two’);

An array is also a literal value, which doesn’t require the explicit use of the Array object:

var newArray = ['one','two'];

Most of examples show a conditional expression that consists usually of one operator and two operands, such as the following:

if (sValue == ‘test’)

However, many times a conditional expression is dependent on several different conditions being met, each represented by an expression and combined through the use of one of JavaScript’s logical operators.

Use Cookie: Cookie is a small browser named data storage. With a particular page or site associated with.Cookie used to provide memory to the browser to the script and the server can be used in a page in another page of input data.

Each JavaScript object is based on one object known as, appropriately enough, Object. JavaScript’s approach to extensibility is a bit unusual. Though current versions of JS are not truly object-oriented, JavaScript does support the concept of a constructor and the ability to create instances of objects through the use of the new method.

JavaScript achieved early widespread use for tasks: validating form contents, or setting and retrieving cookies (small bits of information that persist even when the browser is closed). JavaScript’s popularity has grown exploded, really隆陋most recently because it is a key component in Ajax (Asynchronous JavaScript and XML), which promises to restructure the way web applications interact with users.

Page 1 of 11