ify">,. , BODY, onLoad.
. ,, Internet Explorer, Netscape Navigator Opera,.
(),..
URL (Uniform Resource Locator) - Web -. Web URL. HREF A, SRC IMG, ACTION FORM .. URL,,, FTP- ftp, Gopher- - gopher, - smtp. URL: # justify gt; URL http - (http).
. ,. Web-. JavaScript. HTTP, JavaScript, URL - JavaScript:
lt; A HREF=«JavaScript: JavaScript _» gt; lt;/A gt;
lt; IMG SRC=«JavaScript: JavaScript _» gt;
«JavaScript_» - JavaScript, -.
, «!!!»:
lt; A HREF=«JavaScript: alert ( !!! );» gt; !!! lt;/A gt;
submit:
lt; FORM NAME=f METHOD=post=«JavaScript: window.document.fiVALUE= raquo ;; void (0); " gt;
lt; INPUT TYPE=submit VALUE=Click gt;
lt;/FORM gt;
URL. , JavaScript, Netscape Navigator Internet Explorer,.
, (handler),,. , Click:
lt; FORM gt; lt; INPUT TYPE=button VALUE=«»=«window.alert ( intuit );» gt; lt;/FORM gt;
SCRIPT - JavaScript-. SCRIPT Server Side Includes, ...
HTML-, SCRIPT. SCRIPT HTML- SCRIPT.
SCRIPT:
. HTML-;
. HTML-.
,,.- JavaScript-.
-. JavaScript Window, ... ,,:
, JavaScript ().. function,,. , JavaScript-.
JavaScript. ,. , Window Document location. Window Location, Document -, URL.
,.
,: toString (). location, window.location,,:
lt; SCRIPT gt; .write (window.location) ;. write (« lt; BR gt;») ;. write (document.location);
lt;/SCRIPT gt;
-,.:
lt; SCRIPT gt;=toString (window.location);=toString (document.location);=window.location.href; .write (w.length) ;. write (d.length) ;. write (h.length);
lt;/SCRIPT gt;
.
, URL, location,.
Window - JavaScript. Window Frame.
Window -, Frame -, HTML- FRAMESET FRAME.
JavaScript. JavaScript,:
var myString= Hello World! raquo ;; myString=new String ( Hello World! );
. ,.:
var n=5; s=new String (n * 20);
s «100». s n * 20, s 100. JavaScript,,.
(var n=new String ( Hello World )) Internet Explorer, (var n= Hello World ).. ,.
, eval ().
,?:
var n= The dog took it s bone outside ';
, «it s». «The dog took it», «s bone outside «. JavaScript (,), [15].
. ,.. , . JavaScript,,,,.
var n=«The dog took it s bone outside»; n= The dog took it s bone outside raquo ;;
,: ''.
indexOf lastIndexOf.
,. indexOf,. , IndexOf - 1. lastIndexOf indexOf,,.
, indexOf lastIndexOf - 1,, -,.
.
· charAt (),.
Test arAt (1)= e .
· length. Test .length=4.
· substring (). Test .substring (1, 2)= e raquo ;.
· substr () substring (),,. , Substr ().
· Test .substr (1, 2)= es raquo ;;
· toLowerCase () toUpperCase (),:.
Test .toUpperCase ()= TEST raquo ;;
:
alert ( This is a Test .indexOf ( T ));// 0 ( This is a Test .lastIndexOf ( T ));// 10 ( This is a Test arAt (5));// I ( This is a Test .length);// 14 ( This is a Test .substring (5, 9));// Is a ( This is a Test .substr (5, 9));// Is a Test ( This is a Test .toUpperCase ());// THIS IS A TEST ( This is a Test .toLowerCase ());// This is a test
,, eval (). eval (), JavaScript.
eval («alert ( Hello World! )»);
«Hello World!», alert. ,,.
Math JavaScript,,. Math.PI,, 3.141592653589793. (sin, cos, tan, ..), (Math.floor,, Math.ceil,, Math.round «»).
,,. JavaScript,,,,,. ,, 5,,, ««.
var n=parseInt («3.14»);// 3n=parseFloat («3.14»)//3.14
parseInt. «3.14», «3», «3.00001» «3.9999» 3.
parseFloat,,. «». , ParseInt («3a») 3.
,,:
var n=5; m=n.toString (); m=n + raqu...