【问题标题】:Popup not load if started from Alert Box如果从警报框启动,弹出窗口不会加载
【发布时间】:2015-08-08 22:35:54
【问题描述】:

我的弹出广告代码是:

<script type='text/javascript' src='//URL'></script>

如果我在window.open 中插入网址,则不会加载。 我也试过了,但没有:

var importantStuff = window.open('http://example.com/waiting.html', '_blank');

如果我将它简单地插入到页面中。为什么?

【问题讨论】:

  • 删除src 部分,看看它是否有效。
  • 我在没有src的window.open中插入,这样:window.open('URL');所有其他链接都有效,只有弹出广告代码无效。

标签: javascript popup alert box


【解决方案1】:

尝试类似:

window.open(
  "http://example.com/waiting.html",
  "Example page",
  "outerWidth=600,width=500,innerWidth=400,resizable,scrollbars,status"
);

这里是一个例子:http://jsfiddle.net/870qnLew/

【讨论】:

  • 结果没有变化。链接打开,我只看到没有加载文本。我认为问题是window.open。我看到一个网站使用 javascript:doClose 关闭警报框并打开弹出窗口,并且对他有用。
  • 我不明白这个问题。检查我添加的示例,如果它是您需要的,请告诉我。
  • 我已经使用了 window.open。窗口弹出启动但未加载。如果我直接在页面中使用此代码 ,弹出窗口会很好地加载。但是,如果我使用带有 window.open 的 URL,则不会加载。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-19
  • 1970-01-01
  • 1970-01-01
  • 2016-05-25
相关资源
最近更新 更多