打开一个链接

时间:2009-12-10 23:08:11

标签: javascript

我想这是可能的,但我不知道如何。

<a rel="width[640];height[480];autostart[true];loop[true];title[Google]" class="jcepopup" href="http://www.google.nl">Aanbieding</a>

可以这样做吗?

<body onload="javascript: laden()">


<script type="text/javascript">

  function laden()

  {

  window.open('http://www.google.nl rel="width[640];height[480];autostart[true];loop[true];title[Google]" class="jcepopup"', 'blablabla', 'width=720', 'heigt=500');

  }

2 个答案:

答案 0 :(得分:0)

是的,但您的onload中不需要javascript:,您可以这样做:

<body onload="laden();">

答案 1 :(得分:0)

这些天来,大多数浏览器因为这种用途而阻止弹出窗口。有几种普遍接受的方法来解决这个问题(我希望闪电不会让我失望)。

  1. 在用户点击
  2. 后打开弹出窗口
  3. 嵌入一些Flash并使用ActionScript打开它
  4. Flash方法非常有名,您可以在线找到有关它的几个链接。如果你可以将一些Javascript推送到某个容器中,你基本上可以绕过这些限制(如果你有创意的话)。例如,Windows Media文件。电影很适合打开弹出窗口。

    我将故意隐瞒这一点,因为我不想对更多弹出窗口的扩散负责。

相关问题