115-manual.html (1691B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>Origin for javascript: with no inherited origin to http:</title> 5 <script type="text/javascript" src="../resources/crossorigin.sub.js"></script> 6 </head> 7 <body> 8 9 <p>Load the following URL in a new tab (copy & paste it into the address bar):</p> 10 <noscript><p>Enable JavaScript and reload</p></noscript> 11 12 <script type="text/javascript"> 13 var origin = 'http://'+httpHostMain; 14 if( location.href.indexOf(origin+'/') ) { 15 document.write('This must be tested on '+origin+'/'); 16 } else { 17 document.write("javascript:'"+escape( 18 '<!doctype html>\ 19 <html>\ 20 <head>\ 21 <title>Origin for javascript: with no inherited origin to http:<\/title>\ 22 <style type="text/css">\ 23 div { height: 100px; width: 100px; background: orange; }\ 24 iframe { width: 500px; height: 120px; border: none; }\ 25 <\/style>\ 26 <script type="text/javascript">\ 27 window.onload = function () {\ 28 var origin = "null (string)";\ 29 document.getElementsByTagName("div")[0].ondragstart = function (e) {\ 30 e.dataTransfer.effectAllowed = "copy";\ 31 e.dataTransfer.setData("text","dummy text");\ 32 };\ 33 document.getElementsByTagName("span")[0].textContent = origin;\ 34 var iframe = document.createElement("iframe");\ 35 iframe.src = "'+location.href.replace(/[^\/]*$/,'HELPER-showorigin.html')+'";\ 36 document.body.insertBefore(iframe,document.getElementsByTagName("div")[0]);\ 37 };\ 38 <\/script>\ 39 <\/head>\ 40 <body>\ 41 <p>Drag the orange square onto the blue square and release it. The blue square should be replaced with the text:<br>\ 42 <span><\/span><\/p>\ 43 <div draggable="true"></div>\ 44 <\/body>\ 45 <\/html>')+"'"); 46 } 47 </script> 48 49 </body> 50 </html>