私が書くとき:
var x = window.open('','','width=480,height=500');
x.document.write('
<html>
<head>
<link rel="stylesheet" type="text/css" href="chat.css" / >
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"><' +'/script>
<script type="text/javascript">
alert("hi");
<' + '/script>
</head>
<body><p>hi</p></body>
</html>');
アラートが表示されます。
でももしそうなら--
x.document.write('
<html>
<head>
<link rel="stylesheet" type="text/css" href="chat.css" / >
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
<' +'/script>
<script type="text/javascript">
$(function(){
alert("hi");
});
<' + '/script>
</head>
<body><p>hi</p></body>
</html>');
それからそれは動作しません。それは何もしません。私は一晩中これを理解しようとしてきました。何か案は?