1

我正在尝试在 wordpress 中使用 javascript 打开一个弹出窗口

我在编辑页面选项中输入了以下代码:

<a href="javascript:void()" onclick="window.open('http://www.google.com', 'mywindow', 'location=no,status=1,scrollbars=1,width=500,height=650');">Click here</a>

上面的代码似乎在 localhost 上运行良好,但在我的实际 Wordpress 站点上却没有运行。

有什么建议么?

4

1 回答 1

1

它确实有效:

http://jsfiddle.net/aPmMe/

但是,如果您仍然遇到问题:

<a href="#" onclick="window.open('http://www.google.com', 'mywindow', 'location=no,status=1,scrollbars=1,width=500,height=650');return false;">Click here</a>
于 2012-06-01T17:23:32.743 回答