我想使用 window.open 方法打开窗口但我想在字符串函数中使用这个函数。我已经写了一些代码,但它不工作。
<head>
<script type="text/javascript" src="../jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
var str= '<a href="javascript:void(0)" onclick="window.open("http://www.google.com","mywin","height=1000, width=500")">google</a>'
$('body').append(str)
})</script>
</head>
<body>
</body>