Created
June 14, 2013 11:50
-
-
Save DanAntFerrari/5781242 to your computer and use it in GitHub Desktop.
Create meta vieport an mobile tag by JS
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
var HandheldFriendlyTag=document.createElement('meta'); | |
HandheldFriendlyTag.id="HandheldFriendly"; | |
HandheldFriendlyTag.name = "HandheldFriendly"; | |
HandheldFriendlyTag.content = "true"; | |
document.getElementsByTagName('head')[0].appendChild(HandheldFriendlyTag); | |
var MobileOptimizedTag=document.createElement('meta'); | |
MobileOptimizedTag.id="MobileOptimized"; | |
MobileOptimizedTag.name = "MobileOptimized"; | |
MobileOptimizedTag.content = "320"; | |
document.getElementsByTagName('head')[0].appendChild(MobileOptimizedTag); | |
var viewPortTag=document.createElement('meta'); | |
viewPortTag.id="viewport"; | |
viewPortTag.name = "viewport"; | |
viewPortTag.content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"; | |
document.getElementsByTagName('head')[0].appendChild(viewPortTag); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment