] 源码如下 ---------------------------------------------------------- <script>if( self == top ){top.location = "/myjs/?u=/hw/asp/jsview.asp?id=311";}</script> <HTML> <HEAD> <TITLE>CreateLink的目标窗口-www.51windows.Net</TITLE> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <META NAME="Author" CONTENT="51windows,海娃,haiwa"> <META NAME="Description" CONTENT="Power by 51windows.Net"> </HEAD> <BODY> <H1 unselectable="on">Creating a Link and Retrieving the URL</H1> <script> function AddLink() { var sText = document.selection.createRange(); if (!sText=="") { if (document.execCommand("CreateLink")) { if(confirm("目标框架在新窗口吗?")) { sText.parentElement().outerHTML=sText.parentElement().outerHTML.replace("<A","<A target=\"_blank\""); } } } else { alert("Please select some blue text!"); } } </script> <P unselectable="on">Select any portion of the following blue text, such as "My favorite Web site". Click the button to turn the selected text into a link. The text will be changed to the URL that you specify.</P> <P style="color=#3366CC">My favorite Web site is worth clicking on. Don't forget to check out my favorite music group!</P>
<BUTTON onclick="AddLink()" unselectable="on">Click to add link</BUTTON> </BODY> </HTML>