javascriptº¯Êý´óÈ«£¨Ò»)
ÉùÃ÷:Õâ¸öÊÇÍøÉϵÄ×ÊÁÏ,²»¹ýÎÒÔںܴó³Ì¶ÈÉϽøÐÐÁË×Ô¼ºµÄ˵Ã÷½éÉÜ,Ï£Íû´ó¼Ò»áϲ»¶¿´
1.document.write("Êä³öÄÚÈÝ");ΪÊä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪµ¥ÐÐ//ºÍ¶àÐÐ/**/
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document->html->(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window->(navigator,screen,history,location,document)
5.»ñÈ¡±íµ¥ÖÐÔªËصÄÃû³ÆºÍÖµ:
document.getElementById("±íµ¥ÖÐÔªËصÄIDÊôÐÔÖµ") ´Ë´¦»ñµÃÔªËØIDµÄ¶ÔÏó
document.getElementByName(“±íµ¥ÔªËصÄNameÊôÐÔÖµ”) ´Ë´¦»ñµÃÔªËØNameµÄ¶ÔÏó
ÕâÑù¾ÍÄÜͨ¹ý¶ÔÏóÀ´»ñÈ¡µ½¶ÔÓ¦µÄÖµ£¬¾ßÌå»ñÈ¡µÄÖµ¾ÍÊÇvalueÊôÐÔ£¨Ò²¾ÍÊǶÔÏó.value£©
6.´óСдת»»µÄJS:
£¨1£©Ð¡Ð´×ª´óд£º
document.getElementById("output").value = document.getElementById("input").value.toUpperCase();
£¨2£©´óдתСд£º
document.getElementById("output").value = document.getElementById("input").value.toLowCase();
ÎÞÂÛÔõôת»»£¬Ö»Òª²»ÊÇ×Öĸ·½Ê½µÄ»°£¬Ò²¾ÍÊÇ°´»ØÔÑù±£Áô
7.JSÖеÄÖµÀàÐÍ:String,Number,Boolean,Null,Object,FunctionµÈ
8.JS
ÖеÄ×Ö·ûÐÍת»»³ÉÊýÖµÐÍ:parseInt(),parseFloat()
ÕâÀïµÄparseInt()·½·¨£¬¾ßÌåʵÏÖ·½Ê½È磺parseInt(“ҪתµÄÄÚÈÝ”)
ÕâÀïµÄparseFloat()·½·¨£¬¾ßÌåʵÏÖ·½Ê½È磺parseFlost(“ҪתµÄÄÚÈÝ”)
9.JS
ÖеÄÊý×Öת»»³É×Ö·ûÐÍ:(""+±äÁ¿)
ÕâÀïµÄ+ÊÇÒ»¸öÁ¬½Ó·û£¬×îÖÕ½á¹û±ä³ÉÒ»¸ö×Ö·û´®µÄÐÎʽ
10.JS
ÖеÄÈ¡×Ö·û´®³¤¶ÈÊÇ:(length)
ÕâÀï¸úvbscriptÓе㲻һÑù£¬vbscriptÀïµÄÊÇlen£¨”ËùÒªÇóµÄ×Ö·û´®³¤¶È”£©£¬¶øjavascriptÀïµÄÔòÊÇÓÃÊôÐԵķ½Ê½À
Ïà¹ØÎĵµ£º
function getOs(){
var OsObject = "";
if(navigator.userAgent.indexOf("MSIE")>0) {
return "MSIE";
}
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
&n ......
Ò³ÃæÄÚǶ²»Í¬µÄÍøÒ³ÄÚÈÝʱ£¬µ¼ÖÂiframeµÄ¸ß¶ÈÎÞ·¨ÓëʵÏÖÄÚÈÝ»òä¯ÀÀÆ÷¸ß¶ÈÏàÆ¥Åä¡£´°¿Ú´óС±ä»»Ê±£¬²»ÄÜiframe²»ÄܽøÐÐ×Ô¶¯µ÷Õû¡£ÕâÀÎÒÃÇÀûÓÃJAVASCRIPTÈÃIFRAME¿ò¼ÜµÄ¸ß¶È×ÔÊÊÓ¦¡£
Ê×ÏÈ£¬Ð´³öÈçϵÄJS·½·¨¡£
/**
* ÄÚǶҳÃæµÄ¸ß¶ÈÉèÖÃ
*/
function handleFrameLoad() {
var hDoc = getBodyHeight(document);
var ......
³£ÓõÄJavaScriptÑéÖ¤ÕýÔò±í´ïʽ
ÏÂÃ涼ÊÇÎÒÊÕ¼¯µÄһЩ±È½Ï³£ÓõÄÕýÔò±í´ïʽ£¬ÒòΪƽ³£¿ÉÄÜÔÚ±íµ¥ÑéÖ¤µÄʱºò£¬Óõ½µÄ±È½Ï¶à¡£ÌØ·¢³öÀ´£¬Èø÷λÅóÓѹ²Í¬Ê¹Ó᣺Ǻǡ£
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [u4e00-u9fa5]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^x00-xff]
ÆÀ×¢ ......
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£º document.body.offsetWidth (°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£º document.body.offsetHeight (°üÀ¨±ßÏߵĸß)
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º document.body.scrollWidth
ÍøÒ³ÕýÎÄÈ«Îĸߣº document.body.scrollHeight ......
JavaScriptΪº¯Êý¶ÔÏó¶¨ÒåÁËÁ½¸ö·½·¨£ºapplyºÍcall£¬ËüÃǵÄ×÷Óö¼Êǽ«º¯Êý°ó¶¨µ½ÁíÍâÒ»¸ö¶ÔÏóÉÏÈ¥ÔËÐУ¬Á½Õß½öÔÚ¶¨Òå²ÎÊýµÄ·½Ê½ÓÐËùÇø±ð£º
Function.prototype.apply(thisArg,argArray);
Function.prototype.call(thisArg[,arg1[,arg2…]]);
´Óº¯ÊýÔÐÍ¿ÉÒÔ¿´µ½£¬µÚÒ»¸ö²ÎÊý¶¼±»È¡ÃûΪthisArg£¬¼´ËùÓк¯ÊýÄÚ²¿µ ......