javascript»ù´¡ÖªÊ¶¡¾×îÏ꾡¡¿
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script>
ÔÚ²»Ö§³ÖJavaScriptµÄä¯ÀÀÆ÷Öн«²»Ö´ÐÐÏà¹Ø´úÂë
3 ä¯ÀÀÆ÷²»Ö§³ÖµÄʱºòÏÔʾ
1: <noscript>
2: Hello to the non-JavaScript browser.
3: </noscript>
4 Á´½ÓÍⲿ½Å±¾Îļþ
1: <script language=”JavaScript” src="/”filename.js"”></script>
5 ×¢Êͽű¾
1: // This is a comment
2: document.write(“Hello”); // This is a comment
3: /*
4: All of this
5: is a comment
6: */
6 Êä³öµ½ä¯ÀÀÆ÷
1: document.write(“<strong>Hello</strong>”);
¡¾È«ÎÄ¡¿
1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script>
ÔÚ²»Ö§³ÖJavaScriptµÄä¯ÀÀÆ÷Öн«²»Ö´ÐÐÏà¹Ø´úÂë
3 ä¯ÀÀÆ÷²»Ö§³ÖµÄʱºòÏÔʾ
1: <noscript>
2: Hello to the non-JavaScript browser.
3: </noscript>
4 Á´½ÓÍⲿ½Å±¾Îļþ
1: <script language=”JavaScript” src="/”filename.js"”></script>
5 ×¢Êͽű¾
1: // This is a comment
2: document.write(“Hello”); // This is a comment
3:
Ïà¹ØÎĵµ£º
ÔÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ
ÖÚËùÖÜÖªwindow.open() º¯Êý¿ÉÒÔÓÃÀ´´ò¿ªÒ»¸öд°¿Ú£¬ÄÇôÈçºÎÔÚ×Ó´°ÌåÖÐÏò¸¸´°Ìå´«ÖµÄØ£¬Æäʵͨ¹ýwindow.opener¼´¿É»ñÈ¡¸¸´°ÌåµÄÒýÓá£
ÈçÎÒÃÇн¨´°ÌåFatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{ ......
ÖÆ×÷ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹Ø֪ʶ¡£
Ò»¡¢ÍøÒ³µÄ¾ø¶Ô´óСºÍÏà¶Ô´óС
Ê×ÏÈ£¬ÒªÃ÷È·Á½¸ö»ù±¾¸ÅÄî¡£
Ò»ÕÅÍøÒ³µÄÈ«²¿Ãæ»ý£¬¾ÍÊÇËüµÄ¾ø¶Ô´óС¡£Í¨³£Çé¿öÏ£¬ÍøÒ³µÄ¾ø¶Ô´óСÓÉÄÚÈݺÍCSSÑùʽ±í¾ö¶¨¡£
ÍøÒ³µÄÏà¶Ô´óСÔòÊÇÖ¸ÔÚä¯ÀÀÆ÷´°¿ÚÖп ......
½â¾öFirefox ÏÂF5ºÍIEÏÂF5 ²»Ò»ÖµÄjavascript ½Å±¾.
var check=function(e)
{
e=e||window.event;
//alert(e.which||e.keyCode);
if((e.which||e.keyCode)==116)
{
if(e.preventDefault)
{ e.preventDefault();}
&nb ......
ÓÃJavaScriptÒþ²Ø¿Ø¼þµÄ·½·¨ÓÐÁ½ÖÖ£¬·Ö±ðÊÇͨ¹ýÉèÖÿؼþµÄstyleµÄ“display”ºÍ“visibility”ÊôÐÔ¡£µ±style.display="block"»òstyle.visibility="visible"ʱ¿Ø¼þ»ò¼û£¬µ±style.display = "none"»òstyle.visibility = "hidden"ʱ¿Ø¼þ²»¿É¼û¡£²»Í¬µÄÊÇ“display”²»µ«Òþ²Ø¿Ø¼þ£¬¶øÇÒ±»Òþ²ØµÄ¿ ......