117-1.html (1249B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Origin for site with document.domain set to a parent domain</title> 5 <style type="text/css"> 6 div { height: 100px; width: 100px; background: orange; } 7 iframe { width: 500px; height: 120px; border: none; } 8 </style> 9 <script type="text/javascript" src="../resources/crossorigin.sub.js"></script> 10 <script type="text/javascript"> 11 window.onload = function () { 12 var origin = 'http://'+httpHostAlias; 13 document.getElementsByTagName('div')[0].ondragstart = function (e) { 14 e.dataTransfer.effectAllowed = 'copy'; 15 e.dataTransfer.setData('text','dummy text'); 16 }; 17 document.getElementsByTagName('span')[0].textContent = origin; 18 document.domain = httpsHostAlias.replace(/^[^.]+\./,''); 19 var iframe = document.createElement('iframe'); 20 iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html'); 21 document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]); 22 }; 23 </script> 24 </head> 25 <body> 26 27 <noscript><p>Enable JavaScript and reload</p></noscript> 28 <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br> 29 <span></span></p> 30 <div draggable="true"></div> 31 32 </body> 33 </html>