我使用下面的代码在新窗口中打开谷歌但在CKeditor中这不起作用。
<div align="center"><button onclick="window.open('http://google.com','_self')">Click here to open <b> google </b>
</button></div>
答案 0 :(得分:1)
将您的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 - how to add permanent onclick event?
希望这有帮助!
答案 1 :(得分:1)
将_self更改为_blank
<div align="center"><button onclick="window.open('http://google.com','_blank')">Click here to open <b> google </b>
</button></div>
这应该有用。