Is there a difference between Java & JavaScript ?
Many people believe that JavaScript is Java because of the similar names. Actually, this is not true & they are two different languages.
JavaScript is an Object Oriented Programming (OOP) language created by James Gosling of Sun Micro-systems and of Netscape. Java is also an OOP language. Many of their programming structures are similar. However, JavaScript contains simpler commands than Java.
What To Do If You Have A Blank PAGE Editor!! & You Don't Know Even How To Generate A Link!! How To Develop A Great Page Using JavaScript Language!! Let Me Help You.. :)
*First Of all, You should add the HTML, HEAD, BODY Tags & The Page Title as follows
*Tip1: Code Inside Head tags is loaded before the rest of the HTML document.
What else is inserted inside the Head Tags beside Title?
*Tip2: Body section contains simple HTML commands, like buttons, links, forms.It's your playground where you insert your content the way you want it to appear in your page.
*Tip3: Title of the page always inserted inside the Head tags.
*So, what is the TITLE tag?
*Any text between the TITLE tags will appear on the top of your browser.
*Suppose you inserted this text "Mos-tafa.com's JavaScript Tips & Tricks! - "Cut & Paste" JavaScript Tricks For Your Page!" inside TITLE tags.
Click here to see how it will look!
Simply, The Meta Tags. Continue To Second Step...
*Second Step: You must add Meta Tags After The TITLE for your site to get listed high in Search Engines.
*Here are The Meta Tags:
Source Code :
Let Me Explain The Meta Tags To make things more clear.
There are other Meta tags you can add to those above, but they are optional to use.
Are Meta Tags Important to be added in my HTML File[WebPage] ?
The answer is YES! Why!? Let me tell you.
The Importance of Meta-Tags
Now, I Finished building my site! It's a Great Site! What's Next! Increase Traffic!! Many people wish their site score and get listed high on the search engines. For this aim to come true, people have to add Meta Tags to HTML Documents, otherwise, their dream won't ever come true! Add Meta Tags Right Now! At the bottom of the page, there is a section where you can create Meta Tags Automatically. Just Fill information and Click on Create. Remember, Meta Tags are inserted between Head Tags.
What else is inserted inside the Head Tags beside Title?
*Cascading Style Sheets(CSS) may be one of the components of Head Section. Continue to third step..
*Third Step:, You begin to write your scripts using JavaScript Language. Notice that any script you write should be inside the Script Tags as follows :
Tip: The Script tag denotes the beginning of JavaScript Code.
The Language Attribute! Is it Important?
Notice also that we defined the language Used which is JavaScript To Inform People That The Code Between Script Tags Is Written In JavaScript. It Also Tells the Browser So. Actually, Till Now It's Optional To Define The Language Used & You Can Use <script> Instead Of <script language="JavaScript"> Why? Due to the dominance of JavaScript over other languages from the start & any Browser Will Realize That.
*After setting up your script, the last step appears, which is inserting the script in the HTML Tags in the Head Section. Sometimes it goes in the Body Section!
*Here is how it will look:
What Is The Relation Between HTML & JavaScript ?
It Is Inside These HTML Documents [WebPages] That JavaScript Code Must Be Inserted Into...
In Other Words, It's Inside The HTML Tags That JavaScript Code Is Inserted Into...Or It's Inside The HTML-Page Where JavaScript Code Is Embedded..
Document object:
*How To write anything Using JavaScript Language (The write Method) :
Source Code :
Description of the above Code: The write method of the document object displays its argument, the text string (Any text).
Here Are All other Document objects:
bgColor [Changes BackGround Color]
write [Writes something]
lastModified [Gives date of document's last change]
writeln [Writes in new line]
referrer [Gives URL of the page that linked here]
fgColor [Changes Text Color]
linkColor [sets the link color in hex code]
alinkColor [sets the active link color in hex code]
vlinkColor [sets the visited link color in hex code]
location [sets the URL of the page]
referrer [sets the URL of the page the user came from . If no page is available, a blank space will be shown]
title [Create a Tile For the page]
Important Fact: Event Handlers are inserted in the HTML TAGS within buttons, check boxes & links NOT in the Script tags.
Let me give an example to make it more clear:
As You see in the above script the Event Handlers "OnMouseOver & OnMouseOut" are inside the HTML Tags & Not Inside The Script Tags...
Here Are The Most Popular Event Handlers:
onclick: [Used To call Execution of JavaScript upon clicking]
onload: [Used To call Execution of JavaScript after the page or an image has completely finished loading]
onmouseover: [Used To call Execution of JavaScript if the mouse moved over a link]
onmouseout: [Used To call Execution JavaScript if the mouse away from a link]
onunload: [Used To call Execution of JavaScript after leaving a page]
-Notice How we inserted the JavaScript inside the HTML Tags.
-Notice also how HTML: [Link(A href) in the previous Example] is used to make JavaScript: [Making Text appears in the Status Bar Using Onmouseover & onmouseout Handlers, window.status command, and by calling a function] Works. Therefore, HTML Is used to make JavaScript Works. This is how HTML & JavaScript are related to each other.
-What Calling Function means? What (A href) means? Don't Worry..U'll Know! All I Want U 2 Know 4 Now is How JavaScript & HTML are related!
Others:
The onFocus Command
This Event Handler is most used in Forms Especially within Textarea, Text Input.
Let Me Give You an Example:
Click Here 4 Example
Source Code:
The onChange Command
Like the OnFocus Event, This Event Handler is most used in Forms Especially within Textarea, Text Input.
To Get the Idea of This Script, I Will give you an example.
Click Here 4 Example
Source Code:
The onSubmit Command
Like the OnFocus Event, This Event Handler is most used in Forms Especially within Textarea, Text Input.
You can Even get the idea of the script from its name.
When you use forms, for example, Guest-Book, after people finish writing their name, E-mail & comments, they click on submit. You can direct them to another page, for example, Thanks Page - The page where you thank your visitors for signing the guest Book.
Source Code :
Other Tips:
The Comment Tags : Used to hide your code against older browsers of both Netscape and IE. Actually, It's Optional Whether To Use It Or Not & You Will Never Have An Error If You Didn't Use It, But It Is Recommended To Use It..
You Can Use The Following Trick To Add Comments Inside the script tags which are ignored by the browser, it may be used to describe the JavaScript, or copyright.
Let Me Give An Example :
What is an HTML file?
-HTML stands for "HyperText Markup Language" and is the language we use to
make Web pages.
-HTML allows you to set titles, insert images on your site, and make hyperlinks, tables, Select Menus & More. It is the language that makes the Web possible.
-An HTML file must have an htm or html file extension.
*Other attributes in the Body Section:
-background="URL of Image to be a Background"
-bgproperties="fixed" Fixes the background image so that it doesn't scroll.
*How to set a Base Font for the entire pages so that you don't have to use font tags every time.
Source Code:
Attributes:
Size="number": Sets the size of the font.
Color="Hex-code" : Sets the font color for the page.
Name="" : Sets the typeface of the font.
How to EMBED a multimedia object, or video or sound file in a page?
First, what's EMBED Function?
It tells the browser to embed multimedia object.
Attributes:
autostart="True/False" : Possible values are "True" or "False". True will let the multimedia object to play by itself upon page load. False : the multimedia object should be activated by the visitor.
height="" : The height of the display in pixels or percentage.
loop="True/False" : Possible values are "TRUE" or "FALSE". True will let the multimedia object repeats continously forever until you stop it . False will let it play one time and stop.
name="" : The name of the object.
src"/mymultimedia/clip.avi" : The URL of the object file.
width=" " : The width of the display in pixels or percentage.
Example:
*Note: For Hex Color Codes Visit Link at the bottom of this page.
*How To Make A Text Colored Or Change Its Size Or Even Make It Bold and Italic :
Source Code :
What attributes Can Be Inserted In The Font Tag ?
*How To Write Any Text With The Typewriter Font ?
Source Code :
*Other HTML Commands To Use:
Source Code :
*What are The Multicol Tags ?
*It Displays text in columns.
Attributes:
cols="" : Sets the number of columns to use.
gutter="pixels" : Sets the space between each column.
width="" : Sets the width of the columns.
*What Is The <P> Tag ?
It Is used For Setting text in a New Paragraphs..It Acts Like A Space
What attributes Can Be Inserted Inside The P Tag ? Only One attribute!
*What Is The <BR> Tag ?
It Is Used For The Multiple Spacing,How? Simply, Repeat The Tag.. Unlike The P Tag Which Can't Do That
*What's The Preformatted Text?
Preformatted Text Is Used To Preserve Both Spaces & Line Breaks.
Source Code :
*Blockquote Tags Is Used To Display A long quotation:
Blockquote Is Used To Display A long quotation.Blockquote Is Used To Display A long quotation.Blockquote Is Used To Display A long quotation.Blockquote Is Used To Display A long quotation.Blockquote Is Used To Display A long quotation.Blockquote Is Used To Display A long quotation.
Source Code :
*Q Tags Is Used To Display Short Quotation:
*Example:
Q Tags Is Used To Display Short Quotation
Source Code :
Source Code :
What attributes Can Be Inserted In The Image Tag ?
Here Is A Source Code For An Image Tag With All Possible attributes Inserted Into..
Source Code :
What Is alt="image" ?
alt="myimage" = The Word "myimage" Will Appear The Browser Didn't Load The Image or when you move your mouse over the image.
So Generally, What's "Alt" ?
It Stands For An "Alternate Text" For An Image
*You Can Use This Command To Center Anything, Image Or A Text :
Source Code :
*How To Make Underlined Text, Striked, Blink, Subscript, Supscript...
Source Code :
*Headings :
*Example:Click Here To See Headings.
Source Code :
*Text Will Be Written From The Right To The Left, If Your Browser Supports Bi-Directional Override.
Your Text Here!
Source Code :
*The Link (A Tag):
Attributes:
*Examples:
*How To Generate A Link In Your Site :
Source Code :
You can shorten the URL if the place where you desire is on the same server..
*Let Me Make It More Clear, If Your Site Is Hosted By AngelFire & You Would Like To Make A Link For This Page "https://www.angelfire.com/hi3/whatever.html" ..Instead Of Writing The Whole URL In The HREF Section You Can Write It As Follows :
*How To Generate Anchor Link In Your Site :
*If you have a long page with lots of info, you may want to provide relative links to sections of your page.
Example:Click Here To Go To The Cut'N'Paste JavaScript Section
Source Code :
*Create An Email Link :
Source Code :
*Create a Picture Link To An E-mail Address:
Source Code :
*How To Make An Image As A Link :
Source Code :
Input Tags
What Is Common In The Input Types ?
*How To Create A Reset Button :
First Of All, What Is The Rest Button?
I Will Give You An Example To Recognize It
Test: Check The Box, Then Press Reset :
Source Code :
*How To Create A Submit Button :
What Is A Submit Button?
Actually, It Is Used To Submit Any Type Of Information.. It's Normally Used In The Forms
Source Code :
*How To Create a Button :
Source Code :
*How To Create a Check Box :
Source Code :
*How To Create a Radio Button :
Source Code :
*Password Field :
*Notice That When You Type Characters In The Password Field, It Will Displays Asterisks Instead Of The Characters.
*Test: Type Anything In This TextArea.
Source Code :
*The Last Type Of Input Tags Is The "Text"
Source Code :
Here Is A Live Example of The Above Code :
*Tips On InPut TyPeS!
*checked: Use this attribute in a RADIO or CHECKBOX type, and it will be pre-selected when the page loads.
*maxlength="number": Sets the maximum number of characters that can be entered in a text input.
Source Code :
Attributes:
behavior="slide/scroll/alternate" : "Scroll" is the default , "slide" makes the text slide from off the screen and then stop, "alternate" makes the text alternate back and forth.
bgcolor="..." : Specifies the background color of the marquee.
align="..." : Possible values of "top", "middle", or "bottom". Specifies the alignment of the text.
direction="Left/Right" : Sets the direction for the text to scroll. Possible values are "left" (default) or "right".
height="in pixel or percentage" : The height of the marquee in number of pixels or % of screen.
width="in pixel or percentage" : Sets the width of the marquee.
*How To create a horizontal line :
Source Code :
*You Can Even Control The Size Of The Line, Let Us Have A Look! :
Source Code :
*How To Control Its Size Using Percentage :
Source Code :
*How To Change Even Its Color And Its Place :
*Note : (color IE only) , Change align To "Center" If You Would Like The Line To Be In The Center & "Left" For The Left ...
Source Code :
Other attributes:
*noshade : The line is drawn solid with no shade.
Different Types Of Lists
*How To Create Numbered List (Ordered List) :
Source Code :
*To Create Unnumbered list (Unordered List) :
Source Code :
*Types Of Unordered List
1.Disc Bullets List
2.Circle Bullets List
3.Square Bullets list
*Types Of Ordered List
1.Letters List
2.LowerCase Letters List
3.Roman Numbers List
4.Lowercase Roman Numbers List
*How To Create a Definition List
Source Code :
*Create a Directory list of items :
*Note : Items should be less than 20 characters long.
Source Code :
*How To Generate Select Menus :
Here Is The Source Code Of The Above SELECT Menu :
What attributes Can Be Inserted In The SELECT Tag ?
Example For The The Multiple Select Tags :
Here Is The Source Code Of The Above :
What attributes Can Be Inserted In The OPTION Tag ?
Here Is An Example Of A Select Menu With 'Selected' Inserted In Option 3 :
Here Is A Live Example Of The Above Code :
*Notice That Option 3 Is The Initial Value(default Value)...This Is How The 'Selected' Option Works.. :)
*As you see this select menu has nothing to do. To make use of the select menu, we should add JavaScript To make it useful. Later in this page, U'll Know how JavaScript make Select menu works.
*How To Generate A Text Area : Creates a multi-lined text entry box.
Source Code :
<FORM>
*Attributes:
cols="Pixel/Percentage" : Sets width the text box will be.
*How To Change Even Its Look, Example: Add BackGround , Control Its Font Color, Style using CSS:
Source Code :
<textarea name="My_Text_Area" rows="5" cols="20" wrap="virtual">
Put your text here</textarea>
</FORM>
rows="Pixel/Percentage" : Sets height the text box will be.
name="example" : Sets the name of the text area.
wrap="Hard/Soft/None" : How text will wrap. Possible values are "hard", "soft", or "none".
<FORM>
<textarea name="My_Text_Area" rows="5" cols="50"
style="background:#your color here"
style="font-family:your font here"
style="font-weight:bold"
style="color:#your font color here"
style="border style:solid"
wrap="virtual"> Put your text here </textarea>
</FORM>
*Note : If You Don't Want Text Inside Text Area To Be Bold , Just Remove The "Font-Weight" Line. Through "Font-Family" You Choose Your Font Style Example: Arial, New Times Roman...
*How To Create a Table :
Here Is The Simple Form :
Heading1 | Heading2 |
---|---|
Description For Title1 | Description For Title2 |
Source Code :
*Good Info: What are Table, TR, TH, TD Tags functions?
What Are The attributes That Can Be Inserted Inside The <Table> Tag :
Possible Values:
VOID: No outer borders are displayed.
ABOVE: Displays a border on the top side of the table.
BELOW: Displays a border on the bottom side of the table.
HSIDES: Displays the top and bottom borders of the table.
VSIDES:Displays the right and left side borders.
LHS: Displays the left-hand side border.
RHS: Displays the right-hand side border.
Possible types:
NONE: No inside borders are displayed.
GROUPS--Displays inner borders between the various table groups such as THEAD, TFOOT, TBODY, and COLGROUP groups.
ROWS--Displays inner borders between the table rows.
COLS--Displays inner borders between the table columns.
ALL--Displays inner borders between all rows and columns.
What Are The attributes That Can Be Inserted Inside The <TD> Or <TH> Tag -The Cell Tag- :
*Here Is An Example Of A Table With Different attributes
Source Code :
Notice that any text inside TH Tag is Bold font (default)!
*Here Is An Example Of A Table With No Border..
Source Code :
*Table Tricks:
Other Uses Of the Table: As a matter of fact, Learning how to establish tables using HTML is very essential. There many things you can do using tables. Let me Give you an example.
*Using tables to line up links or Buttons:
Source Code:
How To Create A Form -The Most Advanced HTML-
*In Order To Achieve This Aim, You Will Go Through 3 Easy Steps.
*First Of All, You Must Set The Form Tags...Inside The Form Tag, We Will Insert Two attributes..
1.method
2.action
*Other attributes in the Form Tag:
target="" : Specifies which window the result of the form will be loaded into.
Values:
*Let Me Explain What That Means.. By Method="post", It Means That We Are Going To Post The Information..So What About action="mailto:you&youremail.com" ?! Actually, It Is The URL To Which You Are Posting The Information. This Normally Has a *.cgi, *.pl, *.php3 Ending.
*Second Step : Set A Title For Your Form, Generally, It Is A Question..
*Third Step : Set The Answers For Your Question, For This Purpose You Can Use Many Things, Like Select Menus, Input Types, For Example : CheckBox, Radio Buttons
*Finally, The Last Step Appears -The Body Of The Form- Generally, It's A Text Area, You May Use It If You Would Like To Allow Visitors To Add Suggestions Or Additional Information..Don't Also Forget To Create The 2 Input Types : 1.Clear 2.Submit At The End Of The Form, The First One To Rest Values If The Visitor Want To Clear Everything He/She Did & The Other One To Submit The Information..
*Let Me Give An Example To Make Things More Clear.. If I Would Like To Ask Visitors To Rate My Site, How Can This Be Done Using Forms...
Source Code :
<form method="post" action="mailto:you@youremail.com">
<b><u>Rate Mostafa.up.to!:</i></b><br>
<input type="checkbox" name="subject">Excellent<br>
<input type="checkbox" name="subject1">Very Good<br>
<input type="checkbox" name="subject2">Good<br>
<input type="checkbox" name="subject3">Poor<br>
<b><i>Your Comments & Suggestions</i></b><br>
<textarea name="body" cols="30" rows="6">You May Insert Msg Here</textarea><br>
<input type="reset" value="Clear"> Or <input type="submit" value="Submit">
</form>
*Note: You Can Change The Email To What Suits You!
This Is How It Will Look :
"_blank" : Loads the result of the form into a new blank window.
"_parent" : Loads the result into the immediate parent of the document the link is in.
"_top" : Loads the link into the full body of the current window.
Excellent
Very Good
Good
Poor
Your Comments & Suggestions
or
*This Is A Greeting Alert Box To Greet Your Visitors. Appears When Any Page Finish Loading..Cool!! Isn't It!
*Test: Check The Box!
Source Code :
*Whenever You Move Your Cursor Over The Link, It Gives A Description For The Link That Appears In The Status Bar!! You Can Customize The The Words That Appear In The Status
Note: Instead Of "Status" You can Use "Window.Status" , It Will Make No Difference. But, In Fact, "status" Command Is A Shortcut To "window.status" Command..This also applies To any Command Starts With Window, Example : "open" Instead of "window.open" , "location" Instead of "window.location" and So On...
*Notice That We Set The " Status=' ' " In The OnMouseOut Event To Clear The Status When The Person Moves His Cursor Away From The Link..
Source Code :
The Object "location"
Source Code :
*location.host: Shows the page URL and the Port.
*Using "window.status"
Example: Move Your Mouse On The Below Link
*How To Create A Button Alert :
Source Code : 2 Ways:
First Way:
Second Way: (By Calling A Function "inform")
Example:
IF-ELSE Statement
What is IF-ELSE Statement?
IF-ELSE Statements allows you to choose between 2 conditions?
Let me give you an example:
Using Confirm Method:
First, let's have a look on the simple form of the confirm command:
*Placing this script in your page will generate an Alert Box with ok & cancel button along with the statement "Do you want to enter this page?"
*How to make a use of this script:
Source Code :
*Another Script: You Can Use This To Ask Users If They Like To Jump To A Certain Page Or Not..A Great Script.. Give It A Try!
Source Code:
*Third Form of the above script:
Source Code :
*Fourth Form of JavaScript Code Used To Ask The Visitors If They Would Like To Enter A Certain Page Or Not.. VerY Useful :)
Source Code :
*You Can Use This Script To Greet Visitors With Their Name.. Very Useful
*Note: Trick Here is in Command "Prompt"
Source Code :
*location.hostname: Shows the page URL.
*Hint: Add If-Else Statement.
*Using If-Else statement, we can allow visitors choose between 2 places :
*When you place this code in your page, before entering the page, you will have an Alert asking you this question "Are you sure you want to enter my website?" If you click "Ok", you will enter yahoo. If "Cancel", you will have an alert with statement "Ok, as you like" & will stay where you are.
Note : You Can Change The "history.go(-1)" by Any Page You Want, history.go(-1) actually tells the browser to go back in the history.
*This Script Is Also Not Useful But You Can Use It To Confuse And Challenge Your Visitors.. The Idea Of This Script That The Link Is Not Clickable.. MmMmmmM Actually, You Can Click The Link , But There's Only One Way..Try To Know It..Paste It In Your Page To Challenge Your Visitors & Keep Them Entertained..
Source Code : 2 Ways:
1st Way: (By Calling A Function)
2nd Way:
Show Me How Clever You Are To Click This Link!
*To Change The BackGround Of The Page :
Source Code :
*To Change The BackGround By A Click On A Button :
Source Code :
*The Core Of The above Script Is: document.bgColor='burlywood'
*To Change The BackGround By Moving Your Mouse Over A Link :
Source Code :
*The Drop Down Menu! It Is Very Cool & It is a Space Saver :
Source Code :
Example
*Open A Page By A Touch To The Link.. Cool!!
*Note : Instead of "window.location" you Can Use "window.open('http://yourpage.com') " , But The Page Will be Opened Like a Pop-Up Window.
Source Code :
Example
Touch This Link To Go To Mostafa.up.to
*Using "window.open" :
*Note : As Mentioned Before, You Can Use "Open" Instead Of "window.open"
*Open A Page By A Click On A Button :
Source Code :
Example
*Create A -GO BACK- Link Without Referring To A Specific Page :
*Note: Instead of "history.back(1)" , You can Use "history.go(-1)"
Source Code :
Other History Commands:
The "History" Object :
*Tell your visitors How many pages they have visited before the page they currently surf.
Source Code :
*How To Create A Good Bye Alert :
Source Code :
*Note: Insert The Code In The Body Tag
*How To Create A Radio Button Alert :
Source Code :
Example
*Frame Breaker :
Source Code :
*Just Check Box To Change Background Color :
Source Code :
*Change Background Color By a click on Radio Button :
Source Code :
*Go To a certain Page by checking a Box :
Source Code :
Example
*Check This Box:
*How To Reload a Page :
*Trick : window.location.reload()
Source Code :
*Obtaining browser Info :
*How To direct Visitors according to the Browsers they Use :
*The Core Of The Below Script Is In "appName" Which Is Used To Indicate The Type Of Browser Used.. Also, "appVersion" Is Used To Indicate The Version Number Of The Browser...
Source Code :
*Tell Your visitors that they use a good browser :
Source Code :
Other Navigator Commands:
The Object "navigator":
appCodeName: Gives the code name given to the browser.
useragent: Turns the hypertext transfer protocol header used by the browser when working with servers so the server knows what it is dealing with.
Example:
Source Code :
*How to have a background sound! (when the page finish loading or when you maximize the browser window).
Source Code :
*How To Close a Page :
*Trick : window.close()
Source Code :
*Other ways to close a window :
Source Code :
How to close a window by its name?
Suppose there is a window called windowX. Suppose you want this window called windowX to be closed when the page finish loading!
To do this, first you need to use the onload event handler. Second, you must add the following statement inside the event handler.
Source Code :
*Here is how the full code will look like:
Source Code :
*How To View a Source of a Page :
*Note : VerY Useful...
Source Code :
Example
*Another JavaScript Code Used to greet visitors with their Names :
Source Code :
*How to inform visitors of the last update date of your page :
Source Code :
*Whenever You Use the command "window.open", You can Control the size of the Opened Window & Many More..Let's See! :
Note: Trick is : window.open('URL', 'NAME', 'ATTRIBUTES')
*For Example :
Source Code :
*Here Are Some Properties Of "Window.Open" You Can Use :
*Note 1 : {0} Off & {1} On
*Note 2 : Instead Of {0} You Can Write {No} & Instead Of {1} You Can Write {Yes} ...
Source Code :
Here Is An Example Of A Window With A "ToolBar, Status" Only
Source Code :
*Image Flip!
*Have a Different Image When You Move Your Mouse Over An Image :
Source Code :
Example :Move Your Mouse On This Sad Face To Make It Smile..
*Just Click on a Link To Have a Msg Written In A New Browser:
Source Code :
*This Script is Used To Call the Execution of Javascript After Image of a Page Has Been Completely Loaded :
*Note: Trick Here Is In The Event: "onload"
Source Code :
*This Script is Used To Call the Execution of Javascript After The Frameset of the Page Has Been Completely Loaded :
*Note: Trick Here Is In The Event: "onload"
Source Code :
*Have an Alert When You Move Your Mouse Over Image :
Test : Move Your Mouse Over Flame :
Source Code :
*Move Your Mouse Over Image To Jump To Your Page :
*Test: Move Your Mouse Over The Smile Face :
Source Code :
*Another JavaScript Code Used To Refresh Or Reload A Page :
Source Code :
Example
*How To Create An Automatic Printing Link :
Source Code :
*How To Create An Automatic Forwarding Link :
Source Code :
*How To Generate PoP-uP Window :
Source Code :
*Open A wInDoW Upon Leaving A Page By Calling A Function "Exit" :
*Note : You Can Use This Script For Example To Allow Visitors To Subscribe To Your Newsletter Through A Window Opened Upon Leaving Your Page :
Source Code :
*Another JavaScript Code Used To Open A Pop-Up Window Upon Page Leaving:
Source Code :
*How To Direct users of your site that are optimized for individual resolutions:
Source Code :
How to create a popup window displaying a message such as "Page Loading Or Please Wait..." while a page is loading? Here I configured it to full size. It will cover the whole screen :
Two Steps :
First Step :
-Place The Code In The Head Section Of Your Page :
Source Code :
Second Step :
-Place It In The Body Tag :
Source Code :
*Create A Shortcut Icon To Your Page :
*Place It In The Head Section Of Your Page :
*Note : You Will Need An Icon Generator Program :
Source Code :
*Another JavaScript Code Used To Create A Good Bye Alert By Calling A Function "Exit" :
Source Code :
*How To Get Rid Of Line Under Any Link (CSS) :
Get Ready For The CSS Tips, You are 100 CM Away From Play With CSS.
Source Code :
*Another JavaScript Code Used To Create An Alert After Page Finish Loading By Calling A Function "Loadalert" & Using The Event "OnLoad" .... :
Source Code :
Free Resources Sites :
*Fonts : Font File
*ClipArt : 321 ClipArt
*321Free.com : 321 Free
*Html Clinic : HtMl Help!
*Audio Clips : Audio Clips
*Reciprocal Link Verification : Link Counter
*Everyone.Net : Everyone.net
*Name Zero (Free Domain) <.com Or .net Or .Org> : NameZero
*Name Demo (Free Domain) <.com Or .net Or .Org> : NameDemo
*Create A Top Sites List : Top Sites Lists
*Design Banners For Your Site To Increase Traffic For Free : Free Banners
*Animation For Your Site : Animation Factory
*Create Your Logos & Buttons : Cool Text
*Create Your Wap Site For Free : Wappy
*Calling A Function To Open A Page By A Click Of A Button :
Source Code :
*It's Pretty Clear Now How To Call A Function. For More Information About This TopicClick Here
Other Tricks Can Be Used apart From The JavaScript Language :
*Other Languages: VBScript
*How To Create The Following Using VBScript :
Note : For IE Browsers Only...
1."Ok" Button
Source Code :
2."Ok" & "Cancel" Buttons
Source Code :
3."Abort", "Retry" & "Ignore" Buttons
Source Code :
4."Yes", "No" & "Cancel" Buttons
Source Code :
5."Yes" & "No" Buttons
Source Code :
6."Retry" & "Cancel" Buttons
Source Code :
*Click Here To DownLoad A VBScript Tutorial.
Playing with CSS.
*Embedding Fonts using CSS!
*Through CSS you can keep a basic font size, type, color for the entire page so that you don't have to use font tags every time.
Remember Basefont tags!!
*Here's an Example:
*To have the effect of these font characteristics on your text, insert your text between "div" tags.
Here's an example:
*Font of Text between div tags , will be blue, arial, bold and italic, size 3 (15 pixels)
Font size correlation between HTML and CSS.
Controlling backgrounds with CSS!
*Notice that Head Style 1 is attributed with red color so that when you insert any text between Head Style 1 tags (h1) will be colored red.
*To have the effect of these text Backgrounds, do the following:
Using CSS to set Backgrounds. When we control backgrounds through CSS, we can have cool background effects that Body tag can't do. Remember Body tag!!
Here's the Basic form of setting a background:
Playing with Backgrounds.
Background Repeat:
Normally, background images will "tile" or fill in the entire screen. With CSS, you can title your background as only vertical, or only horizontal.
Use The following code to do this:
*Background Position.
Here's an Example of a centered Background:
*Possible values are: top center, center bottom, bottom left, center center & so on.
How to set a fixed background: Background Will not scroll.
*Get rid of underline links!
*Rollover text links.
*How to have a different link color when you move your mouse over a link.
*Other CSS Commands:
*All a style definition consists of a tag followed by a list of specifications enclosed in fancy brackets.
*What Is A JavaScript Link? A Good Question!!
*A link is Used activate a JavaScript command upon clicking. Simply use the keyword JavaScript: , along with the code :
*Let Me Give An Example :
*When You Click The Link In A Page, The Page Will Be Reloaded.
*How To Move A WiNdOw By Clicking A Button :
*Trick Here Is In "MoveBy()" :
Source Code :
*How To Write AnyThing In A TextArea & Click On A BuTTON To Have It Alerted :
Example
Click Here For An Example.
Source Code :
*The Date Object :
*First Step : What Can Be Done To activate a Date Object!
*Simply, Begin Your Code With The Object "New Date()" :
*Third Step : Choose A JavaScript Command To Display The Date :
*Note: output Will Be As Follows : Year/Month/Day
*Note 2: I Added "1" To The Month, Since In JavaScript, It Counts Months Starting From "0", Not "1".
Here Is An ExAmPlE Of A Date :
Who Said That The Books Age Has Gone!! Actually,"A book is worth a thousand web pages"
JavaScript Books On The Amazon
Securing Java: Getting down to business with mobile code
Here Is A list of some useful resources I Found While Surfing!
JavaScript Reference
The Netscape's Javascript documentation
JScript Web Page
Microsoft's JScript documentation
The AskAway! Network
A unique directory of FAQs
Yahoo! JavaScript Links
Yahoo's directory of JavaScript links
Focus on Javascript
About.com's Javascript directory
The Web Design Resource
Everything related to web site design
Doc Javascript
Javascript tips and lots of how-to columns
The JavaScript Source
An excellent "Cut & Paste" JavaScript library
Website Abstraction
Tutorials, scripts, applets, discussion forum...
Dynamic Drive Free DHTML scripts to add to your site
The Programming Sharehouse
Programming resources for many languages
JavaFile
A good collection of free Javascripts
JavaScript-Intro by Voodoo
A very through Javascript tutorial.
The JavaScript Planet
Lots of free Javascripts
NCSA-A Beginners Guide to HTML
The best site to start
HTML Tutorials in Web Page Design
Very through HTML tutorial
The HTML Guide
Another good HTML tutorial
Webmaster Tools
HostReview.com
Compare more than 1600 hosting plans.
!Register-It!
Register your site with search engines
Submit-It!
Another submission service
WebPosition
Monitor your site's ranking in search engines
Position Agent
Another service to find your search engine ranking
Web Site Garage
Tune up your web site
GifCruncher
Reduce the size of your GIF images
ListBot
Add a free mailing list to your site
Extreme Tracking
Track visitors to your web site
VantageNet Web Services
Free discussion forum and polls
WebmasterBoard
Discussion Forum for Webmasters
Site Add
Submit your site to several Serach Engines
Just Click Here!!
Also Please Have A Look On HostIndexSearch Nearly Over 3,000 Web Hosts At The Largest Hosting Directory..Also Free Domains & Free Website Design & More...Just Give It A Try..
Reviews of hosting providers offering free home pages. Includes reviews of webmaster utilities, domain names, email, and site design tools. Just Click Here!
Free Linkbot Personal Download from Watchfire. Check for more than 50 types of website problems. Eliminate broken links, faulty transactions, and slow loading pages! Replace your manual web page testing with Linkbot! Linkbot Personal gives you the power to make sure your website works.
Download a FREE Copy of Linkbot Personal NOW!
What are people doing on your website?
Ahmed visits your website. Do you know where he came from? What links he clicked on? Whether he encountered any error pages? Do you know what browser and Operating System Ahmed is using?
If you don't know these facts, how can you improve your site? Stop guessing, download a free trial of WebTrends and start knowing Click Here!
GIF2SWF is a single-purpose tool for converting animated GIF images into Shockwave format. Simply load up your animated GIF file, click on the convert button, and you'll have a Flash file which you can then embed onto your webpage.
Program Name: GIF2SWF v1.0 (Windows - Freeware)
URL: http://www.anthillweb.com/daunis/gif2swf.htm
For more on Flash and the different tools available to create Flash files, read "Get Flashed" at Click Here
5 Stars Trick
When a user is on your site, you have to assume that they want to stay there for a long time. Hopefully they stay and browse your entire site to see its content. This is something you definitely want. But something that can change all that is linking your advertisements or links to other sites in the "same" window. If you want users to stay visiting, it is a good idea to have your out-of-site links come up in a "new" browser widow. You can do this very easily by adding a very small amount of code to your links code.
Add target="blank_" to the end of the href tag like this:
Source :
When your text is clicked on now, the site will opened up in a new window, and your site will still be accessible right underneath the new window. Now the user can visit your linked site, and your own at the same time without any worry.
A Cool Script:
Want a pop-up window that automatically centers on a user's
screen? Check out the JavaScript for just such a pop-up at:
http://www.dynamicdrive.com/dynamicindex8/autocenter.htm
Do you dream of having a -TRAFFICJAM- of visitors to your Web site? Well,now you can and best of all you can do it for FREE - with TrafficJam.com!
Remember:
MORE TRAFFIC = MORE MONEY!
Online Resources at BraveNet.com
Making Money Online:
http://www.bravenet.com/reviews/money/
Tons of Webmaster Freebies:
http://www.bravenet.com/reviews/freebies/
Webmaster Freeware (Free Software):
http://www.bravenet.com/reviews/freeware/
Discounted Webmaster Software:
http://www.bravenet.com/reviews/software/
A Cool Trick: Dynamic Background Colors
This little HTML snippet is a lot of fun as it allows your user to
choose a background color for a page dynamically from your site. Play around with this one to choose colors that fit your site design!
Remote Sourcing of Scripts:
There's no question about it, JavaScripts add functionality and fun to any Website. One drawback is they can clutter up your code, and people can take your code right from your page. To fix these issues, you can remotely source your scripts from a directory on your server. This will shorten your page code and your scripts will not be displayed. Of course, in order for the script to work, the visitor will have to download it so they can be found in a browser's temp directory or cache. Still, remote script sourcing is great because the script resides in its own file and it's easy to make site-wide changes.
So, how do we do this? First off, we need a script. Here's a handy date generator you can use to display the current date on your site (remember, though, the date will be the one that a user's own computer is indicating).
Source Code :