最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why this window.opener.reload is not a function error? - Stack Overflow

programmeradmin2浏览0评论

I have a snippet like this.

if (window.opener != null) {
    window.opener.reload();
}

When called, firebug shows,

TypeError: window.opener.reload is not a function

And Chrome console says,

Uncaught TypeError: Object [object global] has no method 'reload'

What could be wrong?

P.S: typeof window.opener is "object".

I have a snippet like this.

if (window.opener != null) {
    window.opener.reload();
}

When called, firebug shows,

TypeError: window.opener.reload is not a function

And Chrome console says,

Uncaught TypeError: Object [object global] has no method 'reload'

What could be wrong?

P.S: typeof window.opener is "object".

Share edited Feb 6, 2014 at 11:48 codeandcloud asked Feb 6, 2014 at 11:42 codeandcloudcodeandcloud 55.3k47 gold badges168 silver badges259 bronze badges 3
  • What does typeof window.opener.reload show? – jacquard Commented Feb 6, 2014 at 11:46
  • anyway, have a look at this link wich might be a workaround: stackoverflow./questions/4571860/… – Ricardo Appleton Commented Feb 6, 2014 at 11:48
  • @RicardoAppleton: what has this got to do with jquery? – codeandcloud Commented Feb 6, 2014 at 11:49
Add a ment  | 

1 Answer 1

Reset to default 6

reload is a method of the location object, not the window object.

window.opener.location.reload();
发布评论

评论列表(0)

  1. 暂无评论