ciframe.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <!--
  3. Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.html or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <title></title>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <script type="text/javascript">
  11. function gup( name )
  12. {
  13. name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ;
  14. var regexS = '[\\?&]' + name + '=([^&#]*)' ;
  15. var regex = new RegExp( regexS ) ;
  16. var results = regex.exec( window.location.href ) ;
  17. if ( results )
  18. return results[ 1 ] ;
  19. else
  20. return '' ;
  21. }
  22. var interval;
  23. function sendData2Master()
  24. {
  25. var destination = window.parent.parent ;
  26. try
  27. {
  28. if ( destination.XDTMaster )
  29. {
  30. var t = destination.XDTMaster.read( [ gup( 'cmd' ), gup( 'data' ) ] ) ;
  31. window.clearInterval( interval ) ;
  32. }
  33. }
  34. catch (e) {}
  35. }
  36. function OnMessage (event) {
  37. var message = event.data;
  38. var destination = window.parent.parent;
  39. destination.XDTMaster.read( [ 'end', message, 'fpm' ] ) ;
  40. }
  41. function listenPostMessage() {
  42. if (window.addEventListener) { // all browsers except IE before version 9
  43. window.addEventListener ("message", OnMessage, false);
  44. }else {
  45. if (window.attachEvent) { // IE before version 9
  46. window.attachEvent("onmessage", OnMessage);
  47. }
  48. }
  49. }
  50. function onLoad()
  51. {
  52. interval = window.setInterval( sendData2Master, 100 );
  53. listenPostMessage();
  54. }
  55. </script>
  56. </head>
  57. <body onload="onLoad()"><p></p></body>
  58. </html>