102-manual.html (1288B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Origin for http site to itself</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://'+httpHostMain; 13 if( location.href.indexOf(origin+'/') ) { 14 document.body.innerHTML = 'This must be tested on '+origin+'/'; 15 return; 16 } 17 document.getElementsByTagName('div')[0].ondragstart = function (e) { 18 e.dataTransfer.effectAllowed = 'copy'; 19 e.dataTransfer.setData('text','dummy text'); 20 }; 21 document.getElementsByTagName('span')[0].textContent = origin; 22 var iframe = document.createElement('iframe'); 23 iframe.src = origin+location.pathname.replace(/[^\/]*$/,'HELPER-showorigin.html'); 24 document.body.insertBefore(iframe,document.getElementsByTagName('div')[0]); 25 }; 26 </script> 27 </head> 28 <body> 29 30 <noscript><p>Enable JavaScript and reload</p></noscript> 31 <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br> 32 <span></span></p> 33 <div draggable="true"></div> 34 35 </body> 36 </html>