Issue: Original page loads text [object window] while invoking Window.open()

来源:互联网 发布:2345软件大全 编辑:程序博客网 时间:2024/05/18 22:56

Issue:

When you invoke following JS codes in original page,

<a href="javascript:window.open('child.html');">

you can open child.html inside a new widow, but original page will loads following text instead of original  content.

text [object window] 

Reason:

This problem is caused by the return value of Open function.

Solution:

Set ‘void’ as the return type of open function in mandatorily.

<a href="javascript:void(window.open('child.html'));">