我正在使用下面的代码在新窗口中打开谷歌,但在 CKeditor 中这不起作用。
<div align="center"><button onclick="window.open('http://google.com','_self')">Click here to open <b> google </b>
</button></div>
将_self更改为_blank
<div align="center"><button onclick="window.open('http://google.com','_blank')">Click here to open <b> google </b>
</button></div>
这应该有效。
将 HTML 更改为:
<div align="center"><!-- ▾ Here -->
<button onclick="window.open('http://google.com','_blank')">
Click here to open <b> google </b>
</button>
</div>
_blank
让浏览器知道它必须进入一个新窗口。
JsFiddle 示例
编辑
尝试看看这里: CKEDITOR - 如何添加永久点击事件?
希望这有帮助!