OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 |
| 3 <head><title>Page with iframe and link</title> |
| 4 <script> |
| 5 function simulateClick(target) { |
| 6 var evt = document.createEvent("MouseEvents"); |
| 7 evt.initMouseEvent("click", true, true, window, |
| 8 0, 0, 0, 0, 0, false, false, |
| 9 false, false, 0, null); |
| 10 |
| 11 return target.dispatchEvent(evt); |
| 12 } |
| 13 |
| 14 function setPortNumber(portNumber) { |
| 15 var link = document.getElementById("cross_site_link"); |
| 16 link.setAttribute("href", "http://foo.com:" + portNumber + "/title2.html"); |
| 17 return true; |
| 18 } |
| 19 |
| 20 function clickCrossSiteLink() { |
| 21 return simulateClick(document.getElementById("cross_site_link")); |
| 22 } |
| 23 </script> |
| 24 </head> |
| 25 |
| 26 <a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br> |
| 27 |
| 28 <p>This page has an iframe. Yay for iframes! |
| 29 <p><iframe src="about:blank"></iframe> |
| 30 |
| 31 </html> |
OLD | NEW |