I'm twiting

访问统计

free counters

打开页面后立即弹出下载窗的方法

因公司项目需要,需要一新页面后立即弹出下载窗口,同时该页面还是有内容的(通常为产品介绍页)。类似Firefox下载页的效果

方法一:
让我们看了一下Firefox的设window.location方法:

  1.     if (gPlatformUnsupported) {
  2.      var uri = location.protocol + '//' + location.host + '/en-US/firefox/unsupported-systems.html' + location.search;
  3.      window.location = uri;
  4.      return;
  5.     }

这样做是可以完成功能,但是我的页面有ready方法(Jquery),一旦location后ready就不能用了。所以这个方法有局限性。

方法二:
Adobe所使用的方法

  1. <meta http-equiv="refresh" content="3;URL=http://airdownload.adobe.com/air/win/download/latest/AdobeAIRSDK.zip" />

目前来说这个方法比较好:1、支持延时。2、不会和ready冲突(不过我没有试过,额……)。

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>