Javascript Basics 01

Written by Lisa Spurlin


Continued from page 1

alert(x) creates an alert that will containrepparttar value defined in variable x (make sure that variable x is defined before calling it)

alert("the number is " + x); -creates an alert that will combine text andrepparttar 105597 value in x.

It Can Do Math Too?

JavaScript wouldn't be much of a programming language if it couldn't do simple math. While there are dozens of complex, built-in math functions, here arerepparttar 105598 basic symbols you'll need to know:

addition + subtraction - multiplication * division / greater than > less than < greater than or equal >= less than or equal <=

What "If" Statements

"If" statements are often used to compare values. Ifrepparttar 105599 statement is true, a set of instructions enclosed in {} executes. Comparisons like this are done usingrepparttar 105600 following symbols:

equals == not equal !=

Inrepparttar 105601 example below, you can see how an "if" statement is used to determine text that displays in an alert window. Copy and pasterepparttar 105602 following script into an HTML page to see it at work.

Notice howrepparttar 105603 instructions for each statement (bothrepparttar 105604 "if" and "else") are enclosed in {}(curly brackets). All curly brackets must have a beginning and ending, just like HTML tags. If a curly bracket is missingrepparttar 105605 JavaScript will return an error, so be sure to proof your code.

________________________________________ This document is provided for informational purposes only, and i-Netovation.com makes no warranties, either expressed or implied, in this document. Information in this document is subject to change without notice. The entire risk ofrepparttar 105606 use orrepparttar 105607 results ofrepparttar 105608 use of this document remains withrepparttar 105609 user. The example companies, organizations, products, people, and events depicted herein are fictitious. No association with any real company, organization, product, person, or event is intended or should be inferred. Complying with all applicable copyright laws isrepparttar 105610 responsibility ofrepparttar 105611 user. Without limitingrepparttar 105612 rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, wit houtrepparttar 105613 express written permission of i-Netovation.com.

If you believe that any of these documents, related materials or any other i-Netovation.com content materials are being reproduced or transmitted without permission, please contact: violation@i-netovation.com.

The names of actual companies and products mentioned herein may berepparttar 105614 trademarks of their respective owners.

(C) Copyright 2002. Lisa Spurlin


Instant plug-in scripts that help you profit... "Special offer expiry date with a twist"

Written by Michel Komarov


Continued from page 1

''+ '

'+ 'Your special offer HTML-code. '+ 'You can use:'+ 'still '+ expiryDays +' days '+ 'or... till '+ expiryDate +' '+ '

'+ ''

); -->

Setrepparttar 105596 expiry date you need at string:

var expiry = new Date(2004,0,1);

Note. Seerepparttar 105597 comment below this string. Month's numbers begin from 0.

You need to place your special offer HTML-code between string

''+

and

''

Then you should quote each your HTML-code line with single quoting symbol (') and addrepparttar 105599 plus symbol (+) atrepparttar 105600 end of each line.

Please note: You shouldn't use single quoting symbol inside your HTML-code. (Use double quoting symbol inside your HTML-code instead.)

You can also placerepparttar 105601 expiry date inside your special offer.

Userepparttar 105602 expiryDate variable. Or you can placerepparttar 105603 number of days tillrepparttar 105604 offer expire, just userepparttar 105605 expiryDays variable.

That's all there is to it, if you follow this link: http://www.icoder.com/pluginscripts/examples/2offer.html you can see how it should look when you've installed it on your web page.

For a more detailed explanation on what JavaScripts are and how to install them please send a blank email here: mailto:jshelp@icoder.com

If you need any help or advice in installing this or any of my other plug-in scripts just let me know and I'll do my best to help ;-)

At your service,

Michel Komarov mailto:michel@icoder.com

Michel Komarov is a fully qualified software engineer with over 5 years experience helping people to automate their online businesses for maximum profits.


    <Back to Page 1
 
ImproveHomeLife.com © 2005
Terms of Use