JavaScript新开窗口
onClick="javascript:window.location=‘http://www.sowsoy.com‘"
JavaScript新开一个页面
<script src=javascript:window.open(‘http://www.sowsoy.com‘)>
JavaScript提示后打开一个页面
<a href="http://www.sowsoy.com" target="_blank" title="点击查看效果" onClick="javascript:alert(‘您是贵宾,欢迎参观我的网站!‘);">
JavaScript 弹出自适应图片窗口
<script language="JavaScript" type="text/JavaScript"> function openPictureWindow_Fever(imageName,alt,posLeft,posTop) { var image=new Image(); image.src=imageName; imageWidth=image.width; imageHeight=image.height; newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop); newWindow.document.open(); newWindow.document.write(‘<html><title>‘+alt+‘</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">‘); newWindow.document.write(‘<img src=‘+imageName+‘ alt=‘+alt+‘>‘); newWindow.document.write(‘</body></html>‘); newWindow.document.close(); newWindow.focus(); } //--> </script> <a href="#"><img src="images/button.gif" border="0" onClick="openPictureWindow_Fever(‘products/girl.jpg‘,‘标题‘,‘100‘,‘100‘)"></a>
JavaScript调用下拉列表打开窗口
<select onChange="if(this.selectedIndex && this.selectedIndex!=0){window.open(this.value);}this.selectedIndex=0;"> <option selected>更多链接……</option> <option value="http://www.sowsoy.com">网页一</option> <option value="http://种豆.com/">网页二</option> <option value="http://www.种豆.com">网页三 </select>
JavaScript开一个新页面时,关闭前一页
<body bgcolor="#FFFFFF" text="#000000" onBlur="self.close()"> </body>
JavaScript关闭当前页
<script language="JavaScript"> function shutwin(){ window.close(); return;} </script> <a href="javascript:shutwin();">关闭当前页</a>
JavaScript定时关闭页面
<script LANGUAGE="JavaScript"> <!-- setTimeout(‘window.close();‘, 3000); // --> </script>
JavaScript页面定时跳转
<script language="JavaScript" type="text/JavaScript"> <!-- function openWin(thetime) { setTimeout("location.href=(‘contact.asp‘)", thetime); } //--> </script> <body onLoad="openWin(‘5000‘)"> </body>
时间: 2024-10-09 17:24:16