Created
July 28, 2015 08:45
-
-
Save laispace/ae3c60783d342cfeaa16 to your computer and use it in GitHub Desktop.
Revisions
-
laispace created this gist
Jul 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ /** * 打开一个新的页面 * @param {String} url */ openWindowByUrl: function(url) { var a = document.createElement('a'); a.href = ''; a.setAttribute("target", '_blank'); var evt = document.createEvent("HTMLEvents"); evt.initEvent("click"); a.dispatchEvent(evt); },