Created
May 18, 2013 03:25
-
-
Save mattbontrager/5603120 to your computer and use it in GitHub Desktop.
Force a link to open in mobile safari from WebApp
This file contains 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 characters
document.getElementById("view_pdf").addEventListener("click", function(evt) { | |
var a = document.createElement('a'); | |
a.setAttribute("href", urlPrefix + cat_directory + filename); | |
a.setAttribute("target", "_blank"); | |
var dispatch = document.createEvent("HTMLEvents"); | |
dispatch.initEvent("click", true, true); | |
a.dispatchEvent(dispatch); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment