OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 |
| 3 <head><title>Simple links</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 clickSameSiteLink() { |
| 15 return simulateClick(document.getElementById("same_site_link")); |
| 16 } |
| 17 |
| 18 function clickCrossSiteLink() { |
| 19 return simulateClick(document.getElementById("cross_site_link")); |
| 20 } |
| 21 </script> |
| 22 </head> |
| 23 |
| 24 <a href="title2.html" id="same_site_link">same-site</a><br> |
| 25 <a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br> |
| 26 |
| 27 </html> |
OLD | NEW |