如何簡單在內的網頁連結,可以另開新視窗的方法
點擊數: 2172
- <html>
- <head>
- </head>
- <body>
- <iframe name="I1" src="tset.htm" onload="setTarget(this)"></iframe>
- </body>
- </html>
- <script>
- function setTarget(i) {
- var links = i.contentWindow.document.links;
- for (var i=0;i<links.length;i++)
- links[i].target = "_blank";
- }
- </script>