javascript ÖеÄwindow.open()º¯ÊýÓ÷¨
javascript ÖеÄwindow.open()º¯ÊýÓ÷¨
¾³£ÉÏÍøµÄÅóÓÑ¿ÉÄܻᵽ¹ýÕâÑùһЩÍøÕ¾£¬Ò»½øÈëÊ×Ò³Á¢¿Ì»áµ¯³öÒ»¸ö´°¿Ú£¬
»òÕß°´Ò»¸öÁ¬½Ó»ò°´Å¥µ¯³ö£¬Í¨³£ÔÚÕâ¸ö´°¿ÚÀï»áÏÔʾһЩעÒâÊÂÏî¡¢°æȨÐÅÏ¢
¡¢¾¯¸æ¡¢»¶Ó¹â¹ËÖ®ÀàµÄ»°»òÕß×÷ÕßÏëÒªÌرðÌáʾµÄÐÅÏ¢¡£ÆäʵÖÆ×÷ÕâÑùµÄÒ³Ãæ
Ч¹û·Ç³£µÄÈÝÒ×£¬Ö»ÒªÍù¸ÃÒ³ÃæµÄHTMLÀï¼ÓÈ뼸¶ÎJavascript´úÂë¼´¿ÉʵÏÖ¡£ÏÂ
Ãæ°³¾Í´øÄúÆÊÎöËüµÄ°ÂÃØ¡£
¡¾1¡¢×î»ù±¾µÄµ¯³ö´°¿Ú´úÂë¡¿
Æäʵ´úÂë·Ç³£¼òµ¥£º
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html')
-->
</SCRIPT>
ÒòΪ×ÅÊÇÒ»¶Îjavascripts´úÂ룬ËùÒÔËüÃÇÓ¦¸Ã·ÅÔÚ<SCRIPT LANGUAGE="javascr
ipt">±êÇ©ºÍ</script>Ö®¼ä¡£<!-- ºÍ -->ÊǶÔһЩ°æ±¾µÍµÄä¯ÀÀÆ÷Æð×÷Óã¬ÔÚÕâ
ЩÀÏä¯ÀÀÆ÷Öв»»á½«±êÇ©ÖеĴúÂë×÷ΪÎı¾ÏÔʾ³öÀ´¡£ÒªÑø³ÉÕâ¸öºÃÏ°¹ß°¡¡£
window.open ('page.html') ÓÃÓÚ¿ØÖƵ¯³öеĴ°¿Úpage.html£¬Èç¹ûpage.html
²»ÓëÖ÷´°¿ÚÔÚͬһ·¾¶Ï£¬Ç°ÃæӦдÃ÷·¾¶£¬¾ø¶Ô·¾¶(http://)ºÍÏà¶Ô·¾¶(..
/)¾ù¿É¡£
Óõ¥ÒýºÅºÍË«ÒýºÅ¶¼¿ÉÒÔ£¬Ö»ÊDz»Òª»ìÓá£
ÕâÒ»¶Î´úÂë¿ÉÒÔ¼ÓÈëHTMLµÄÈÎÒâλÖã¬<head>ºÍ</head>Ö®¼ä¿ÉÒÔ£¬<body>¼ä</b
ody>Ò²¿ÉÒÔ£¬Ô½Ç°Ô½ÔçÖ´ÐУ¬ÓÈÆäÊÇÒ³Ãæ´úÂ볤£¬ÓÖÏëʹҳÃæÔçµãµ¯³ö¾Í¾¡Á¿Íù
Ç°·Å¡£
¡¾2¡¢¾¹ýÉèÖúóµÄµ¯³ö´°¿Ú¡¿
ÏÂÃæÔÙ˵һ˵µ¯³ö´°¿ÚµÄÉèÖá£Ö»ÒªÔÙÍùÉÏÃæµÄ´úÂëÖмÓÒ»µã¶«Î÷¾Í¿ÉÒÔÁË¡£
ÎÒÃÇÀ´¶¨ÖÆÕâ¸öµ¯³öµÄ´°¿ÚµÄÍâ¹Û£¬³ß´ç´óС£¬µ¯³öµÄλÖÃÒÔÊÊÓ¦¸ÃÒ³ÃæµÄ¾ßÌå
Çé¿ö¡£
<SCRIPT LANGUAGE="javascript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0,
left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n
o, status=no')
//д³ÉÒ»ÐÐ
-->
</SCRIPT>
²ÎÊý½âÊÍ£º
<SCRIPT LANGUAGE="javascript"> js½Å±¾¿ªÊ¼£»
window.open µ¯³öд°¿ÚµÄÃüÁ
'page.html' µ¯³ö´°¿ÚµÄÎļþÃû£»
'newwindow' µ¯³ö´°¿ÚµÄÃû×Ö£¨²»ÊÇÎļþÃû£©£¬·Ç±ØÐ룬¿ÉÓÿÕ''´úÌ棻
height=100 ´°¿Ú¸ß¶È£»
width=400 ´°¿Ú¿í¶È£»
top=0 ´°¿Ú¾àÀëÆÁÄ»ÉÏ·½µÄÏóËØÖµ£»
left=0 ´°¿Ú¾àÀëÆÁÄ»×ó²àµÄÏóËØÖµ£»
toolbar=no ÊÇ·ñÏÔʾ¹¤¾ßÀ¸£¬yesΪÏÔʾ£»
menubar£¬scrollbars ±íʾ²Ëµ¥À¸ºÍ¹ö¶¯À¸¡£
resizable=no ÊÇ·ñÔÊÐí¸Ä±ä´°¿Ú´óС£¬yesΪÔÊÐ
Ïà¹ØÎĵµ£º
<P>JScript ÖеÄÔËËã·ûÓÅÏȼ¶ÊÇÒ»Ì×¹æÔò¡£¸Ã¹æÔòÔÚ¼ÆËã±í´ïʽʱ¿ØÖÆÔËËã·ûÖ´ÐеÄ˳Ðò¡£¾ßÓнϸßÓÅÏȼ¶µÄÔËËã·ûÏÈÓڽϵÍÓÅÏȼ¶µÄÔËËã·ûÖ´ÐС£ÀýÈ磬³Ë·¨µÄÖ´ÐÐÏÈÓÚ¼Ó·¨¡£</P>
<P>ÏÂ±í°´´Ó×î¸ßµ½×îµÍµÄÓÅÏȼ¶Áгö JScript ÔËËã·û¡£¾ßÓÐÏàͬÓÅÏȼ¶µÄÔËËã·û°´´Ó×óÖÁÓÒµÄ˳ÐòÇóÖµ¡£</P>
<DIV ......
·â×°£ºÍ¨¹ý±Õ°ü²ÅËãµÄÉÏÊÇÕæÕýÒâÒåÉϵķâ×°
<script type="text/javascript">
function myInfo(){
var name ="ÀÏÓã",age =27;
var myInfo = "my name is" + name + "i am" + age  ......
1¡¢javascript¾ßÓÐÏÂÁÐÖÖÀàµÄÔËËã·û£ºËãÊõÔËËã·û;µÈͬÔËËã·ûÓëȫͬÔËËã·û;±È½ÏÔËËã·û;
¡¡¡¡2¡¢Ä¿µÄ·ÖÀࣺ×Ö·û´®ÔËËã·û;Âß¼ÔËËã·û;ÖðλÔËËã·û;¸³ÖµÔËËã·û;
¡¡¡¡3¡¢ÌØÊâÔËËã·û£ºÌõ¼þÔËËã·û;typeofÔËËã·û;´´½¨¶ÔÏóÔËËã·ûnew;deleteÔËËã·û;voidÔËËã·ûºÅ;¶ººÅÔËËã·û;
¡¡¡¡ËãÊõÔËËã·û£º ......
·½·¨Ò»¡¢
NPN_GetURL(m_Instance, "javascript:test()", NULL);
·½·¨¶þ¡¢
NPVariant rval;
NPN_InvokeDefault(m_Npp, objectDisconnect ,NULL, 0,&rval);
NPN_ReleaseVariantValue(&rval);
ÒÔÏÂÊÇjavascript
<script type="text/javascript">
&nb ......
metaÊÇÓÃÀ´ÔÚHTMLÎĵµÖÐÄ£ÄâHTTPÐÒéµÄÏìӦͷ±¨ÎÄ¡£
meta ±êÇ©ÓÃÓÚÍøÒ³µÄ<head>Óë</head>ÖУ¬meta ±êÇ©µÄÓô¦ºÜ¶à¡£
meta µÄÊôÐÔÓÐÁ½ÖÖ£ºnameºÍhttp-equiv¡£nameÊôÐÔÖ÷ÒªÓÃÓÚÃèÊöÍøÒ³£¬
¶ÔÓ¦ÓÚcontent£¨ÍøÒ³ÄÚÈÝ£©£¬ÒÔ±ãÓÚËÑË÷ÒýÇæ»úÆ÷È˲éÕÒ¡¢·ÖÀà
£¨Ä¿Ç°¼¸ºõËùÓеÄËÑË÷ÒýÇ涼ʹÓÃÍøÉÏ»úÆ÷ÈË×Ô¶¯²éÕÒm ......