麻烦朋友进来看看
我用XSL做摸版,然后用JS加载并用document.write输出,输出的页面很正常,但是我的页面中body里有个onload= "alert( 'aaa '); ",输出页面之后不执行alert( 'aaa ');,请问怎么做才能执行这个alert( 'aaa ');
------解决方案--------------------整体来说是你的思路不对,没有理解onload事件的执行时机。一般来说document.write出来的代码中的onload是不可能被触发的,但是你可以作为一个文档open(作为当前文档的frame)然后再write。   
  <HTML>  
  <HEAD>  
  <TITLE>  New Document  </TITLE>  
  <SCRIPT LANGUAGE= "JavaScript ">  
  <!-- 
 function init() 
 { 
 	test.document.open(); 
 	test.document.write( " <html>  <head>  </head>  <body onload= 'alert(11) '> iframe </body>  </html>  "); 
 	test.document.close(); 
 } 
 //-->  
  </SCRIPT>  
  </HEAD>  
  <BODY onload= "init() ">  
  <iframe name= "test "/>  
  </BODY>  
  </HTML>