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