Unable to modify the parent container element before the child element is closed
用IE 8打开页面时,有时会出现这样的提示:
Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
引起该问题的代码:
<ul id="header_userinfo">
<li><script type="text/javascript">GetLoginInfo(location.href)</script></li>
</ul>
<li><script type="text/javascript">GetLoginInfo(location.href)</script></li>
</ul>
解决方法:
<ul id="header_userinfo">
<li><script type="text/javascript">$(document).ready(function() { GetLoginInfo(location.href); });</script></li>
</ul>
<li><script type="text/javascript">$(document).ready(function() { GetLoginInfo(location.href); });</script></li>
</ul>