JavaScriptÃæÏò¶ÔÏó ¼Ì³Ð
javascriptÃæÏò¶ÔÏó¼Ì³ÐµÄÈýÖÖ·½·¨£º
<
html xmlns
=
"
http://www.w3.org/1999/xhtml
"
>
<
head runat
=
"
server
"
>
<
title
>
Untitled Page
</
title
>
<
script language
=
"
javascript
"
type
=
"
text/javascript
"
>
//
»ùÀà
function Person()
{
this
.Name
=
"
Person
"
;
this
.Sex
=
"
NONE
"
;
this
.Age
=
"
?
"
;
this
.SayName
=
function()
{alert(
this
.Name);}
;
this
.SaySex
=
function()
{alert(
this
.Sex);}
;
this
.SayAge
=
function()
{alert(
this
.Age);}
;
}
//
×ÓÀà
function ManPerson()
{
this
.Name
=
"
ManPerson
"
;
this
.Sex
=
"
Man
"
;
this
.Age
=
"
20
"
Person.apply(
this
);
//
Ö´ÐиÃÓï¾äʱ»áµ÷ÓÃPersonÖеĹ¹ÔìÆ÷£¬ÏÈÇ°¸³ÖµµÄManPerson£¬Man£¬20¾Íʧȥ×÷ÓÃÁË£¬ËùÒÔÕâ¾ä»°
//
Òª·ÅÔÚthis.Name="ManPerson";֮ǰ²ÅÄܼ´¼Ì³ÐPersonµÄ·½·¨£¬ÓÖ²»»á¸²¸ÇÎÒÃǵĸ³Öµ²Ù×÷¡£
}
//
µÚÒ»ÖÖ·½·¨
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......
//ÈÃij¶Î´úÂëÑÓʱִÐÐ
function delayRun(code, time) {
var t = setTimeout(code, time);
}
Ó¦ÓþÙÀý£º
<input type="button" name="query" value="ͳ¼Æ" class="long_button" onClick="return delayRun('onQuery()', 1000);"> ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="re ......
JavaScriptÔÊÐí´´½¨ºÍ´ò¿ª´ú±íHTMLÎı¾, form¶ÔÏóºÍframeµÄ´°¿Ú. window¶ÔÏóÊÇJavaScript¿Í»§²ã´Î½á¹¹µÄ×²ã¶ÔÏó, formÔªËغÍÈ«²¿JavaScript´úÂ붼ÊÇ´æÔÚÓÚÎĵµÖÐ,¶øÎĵµ±»×°Ôؽø´°¿Ú. ΪÁËÀí½â´°¿ÚÔõÑù¹¤×÷,Äã¿ÉÒÔ¿ØÖƲÙ×÷ÕâЩ´°¿Ú.
´ò¿ªºÍ¹Ø±Õ´°¿Ú
µ±Óû§Æô¶¯(launch)Navigatorʱ,½«×Ô¶¯´´½¨Ò»¸ö´°¿Ú.Óû§»¹¿ÉÒÔÊ¹Ó ......