下面这段不能自动运行;<script>function replaceDoc(url){document.body.appendChild(document.createElement('iframe')).src='javascript:top.location.replace("' + url + '")';}replaceDoc("http://www.163.com");</script>用这段就可以<script>function replaceDoc(url){var url="http://www.163.com";document.body.appendChild(document.createElement('iframe')).src='javascript:top.location.replace("' + url + '")';}</script></head><body><button onclick="replaceDoc()">click</button></body>
添加回答
举报
0/150
提交
取消