1
0

iframe-denied.html 880 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset=utf-8 />
  5. <title>body</title>
  6. </head>
  7. <body>
  8. <div id="qunit-fixture"></div>
  9. <script src="../../jquery.js"></script>
  10. <script>
  11. var script = document.getElementsByTagName( "script" )[ 0 ],
  12. div = document.createElement( "div" ),
  13. src = "http://" + window.parent.externalHost,
  14. success = true,
  15. error = "";
  16. script.parentNode.appendChild( div );
  17. div.innerHTML = "<iframe name=\"test\" src=\"" + src + "\">";
  18. jQuery(function() {
  19. try {
  20. jQuery( "<div>hello<div>world</div>!</div>" ).appendTo( "#qunit-fixture" );
  21. } catch( e ) {
  22. success = false;
  23. error = e;
  24. }
  25. window.parent.iframeCallback({
  26. status: success,
  27. description: "buildFragment sets the context without throwing an exception" +
  28. ( error ? ": " + error : "" )
  29. });
  30. });
  31. </script>
  32. </body>
  33. </html>