JavaScript³£Ó÷½·¨×ܽᗗIE¹¦ÄÜ»ã×Ü
IE¹¦ÄÜ»ã×Ü
<OBJECT id=WebBrowser height=0 width=0
classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></OBJECT>
<INPUT onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=´ò¿ª name=Button1>
<INPUT onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=Áí´æÎª name=Button2>
<INPUT onclick=document.all.WebBrowser.ExecWB(10,1) type=button value=ÊôÐÔ name=Button3>
<INPUT onclick=document.all.WebBrowser.ExecWB(6,1) type=button value=´òÓ¡ name=Button>
<INPUT onclick=document.all.WebBrowser.ExecWB(8,1) type=button value=Ò³ÃæÉèÖà name=Button4>
<INPUT onclick=window.location.reload() type=button value=ˢРname=refresh>
<INPUT onclick="window.external.ImportExportFavorites(true,'');" type=button value=µ¼ÈëÊղؼРname=Button5>
<INPUT onclick="window.external.ImportExportFavorites(false,'');" type=button value=µ¼³öÊղؼРname=Button32>
<INPUT onclick="window.external.AddFavorite(location.href, document.title)" type=button value=¼ÓÈëÊղؼРname=Button22>
<INPUT onclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=ÕûÀíÊղؼРname=Submit2>
<INPUT onclick='window.location="view-source:" + window.location.href' type=button value=²é¿´Ô´Îļþ name=Button7>
<INPUT onclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=ÓïÑÔÉèÖà name=Button6>
<INPUT onclick="document.execCommand('Cut')" type=button value=¼ôÇÐ>
<INPUT onclick="document.execCommand('Copy')" type=button value=¿½±´>
<INPUT onclick="document.execCommand('Paste')" type=button value=Õ³Ìù>
<INPUT onclick="document.execCommand('Undo')" type=button value=³·Ïû>
<INPUT onclick="document.execCommand('Delete')" type=button value=ɾ³ý>
<INPUT onclick="document.execCommand('Bold')" type=button value=ºÚÌå>
<INPUT onclick="document.execCommand('Italic')" type=button value=бÌå>
<INPUT onclick="do
Ïà¹ØÎĵµ£º
ÀàµÄ¶¨ÒåÓÐ3ÖÖ»ù±¾·½·¨:
1¡¢´´½¨²¢ÄÜ·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄº¯Êý(¹¤³§º¯Êý)È磺
function wu()
{
var w=new object;
o.a=1;
return o;
}ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó£ºvar u=wu();
2¡¢´´½¨¹¹Ô캯Êý£¬ÓÃnewʵÀý»¯ÀýÈ磺
function wu()
{this.a=1;}
ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó: var u=new wu();
3¡¢ÔÐÍ·½Ê½,À ......
Definition and Usage
¶¨ÒåÓëÓ÷¨The constructor property is a reference to the function that created an object.
constructorÊôÐÔÊÇËù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼Syntax
Óï·¨object.constructor
Example 1
¾ÙÀý
In this example we will show how to use the constructor property:
ÔÚÕâ¸ö¾ÙÀýÖÐÎÒÃǽ«Õ¹Ê¾ÈçºÎʹÓÃcons ......
1.document.write( " "); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document- >html- >(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window- >(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËØµÄÃû³ÆºÍÖµ:document.getElementById( "±íµ¥ÖÐÔªËØµÄID號 ").name(»òvalue)
6.Ò»¸ö ......
¸ù¾ÝÉí·ÝÖ¤ºÅÂëÈ¡µÃÉúÈÕÓëÐԱ𣬲¢ÅжÏ18λÉí·ÝÖ¤µÄÕýÈ·Óë´íÎó:
function showBirthday(val){
var birthdayValue;
if(15==val.length){//15λÉí·ÝÖ¤ºÅÂë
birthdayValue = val.charAt(6)+val.charAt(7);
if(parseInt(birthdayValue)<10){
birthdayValue = '20'+birthdayValue;
}else{
birthdayValue = '1 ......
¼¸¸ö±íµ¥ÑéÖ¤µÄ
function checkMail(obj,error)
{
if (obj == null)
return "NULL";
if (obj.value == "")
return "EMPTY";
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(obj.value))
return true;
else
alert(error);
return false;
}
......