Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes
CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes

JavaScript > Code Examples

A Form for Entering a URL

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
A Form for Entering a URL <HTML> <HEAD> <TITLE>Load URL - Happy Codings :-) JavaScript Code Examples</TITLE> <SCRIPT LANGUAGE="JavaScript"><!-- function loadFrames() { ix = document.URLform.protocol.options.selectedIndex urlString = document.URLform.protocol.options[ix].value+"//" urlString += document.URLform.hostname.value path = document.URLform.path.value if(path.length > 0) { if(path.charAt(0)!="/") path = "/"+path } urlString += path parent.frames[1].location.href=urlString } // --></SCRIPT> </HEAD> <BODY> <FORM ACTION="" NAME="URLform"> <P>Select protocol: <SELECT NAME="protocol" SIZE="1"> <OPTION VALUE="file:" SELECTED="SELECTED">file</OPTION> <OPTION VALUE="http:">http</OPTION> <OPTION VALUE="ftp:">ftp</OPTION></SELECT></P> <P>Enter host name: <INPUT TYPE="TEXT" NAME="hostname" SIZE="45"></P> <P>Enter path: <INPUT TYPE="TEXT" NAME="path" SIZE="50"></P> <INPUT TYPE="BUTTON" NAME="load" VALUE="Load URL" ONCLICK="loadFrames()"> </FORM> </BODY> </HTML>
Controlling Script Errors
Define custom event
Window Open method
Number slider
Animation: toggle
Convert stack to array
Find tag in another tag
Check a Radio Button
'abbr' Property
document.vlinkColor
Math log10e Property
A Clock Script