I'm trying to insert a new meta tag within the Head, I'm using a content managment system that won't allow editing within the Head so I'm attempting to do this using jQuery. Unfortunately I can't it to work.
This is the code I've added to the following webpage: http://www.newcastlegateshead.com
<script type="text/javascript">
$("head").append("<meta name=viewport content=width=400, initial-scale=0.45, minimum- scale=0.45/><link rel=apple-touch-icon href=/images/customIcon.png/><meta name=apple-mobile-web-app-capable content=no /><meta name=apple-mobile-web-app-status-bar-style content=black-translucent /><link rel=apple-touch-icon-precomposed href=/images/customIcon.png/> ");
</script>
This worked for me ... thank you @thecodeparadox. For me to get it to work I needed single quotes not double quotes before and after
Try your code within
Short form of
$(document).ready(function() {...})
is:This will ensure that you code will execute during
onload
.