[英]Can we add javascript in IE conditional comment just before </body>
This code should i place this code at bottom of body it's in conditional comment. 我应该将此代码放在body的底部,这是条件注释。
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta2)/IE7.js"></script>
<![endif]-->
Conditional comments use the syntax of normal comments: <!--
[if …]>…<![endif]
-->
. 条件注释使用普通注释的语法:
<!--
[if …]>…<![endif]
-->
。 That's why browsers that don't understand them ignore them. 这就是为什么不理解它们的浏览器会忽略它们。 So they can be put wherever normal comments are allowed.
所以它们可以放在允许正常注释的地方。 And the
script
element is allowed to be child of the body
element . 并且允许
script
元素是body
元素的子元素 。
So you can put that conditional comment at the bottom in your body
element. 因此,您可以将该条件注释放在
body
元素的底部。
Yes. 是。 Conditional comments do not have to be in the head tag.
条件注释不必位于head标记中。
http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
You can put that code in the <head>
tag and it will work. 您可以将该代码放在
<head>
标记中,它将起作用。
But it can go anywhere. 但它可以去任何地方。
<!--[if lte Gecko 3.1]><script type="text/javascript">
Cufon.replace('.cufonised p, H2');
</script> <![endif]-->
Could this work? 这可行吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.