简体   繁体   中英

Adding a meta tag via jquery?

I need to add this meta-tag in the head section of the page as i need the page to force IE7.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

I am using DNN 5.6

How can i do this?

$('head').append('<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> ');

Though I'm not certain it will have an affect as it will be generated after the page is loaded

-- edit --

If you want to add meta data tags for page description, use the SETTINGS of your DNN page to add Description and Keywords. Beyond that, the best way to go when modifying the HEAD is to dynamically inject your code into the HEAD via a third party module.

Found at http://www.dotnetnuke.com/Resources/Forums/forumid/7/threadid/298385/scope/posts.aspx

This may allow other meta tags, if you're lucky

-- edit 2 --

Additional HEAD tags can be placed into Page Settings > Advanced Settings > Page Header Tags.

Found at http://www.dotnetnuke.com/Resources/Forums/forumid/-1/postid/223250/scope/posts.aspx

There is really no use in adding <meta> headers after the page has loaded.

To force IE7 rendering, change the underlying HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM