IE6 and IE7, innerhtml the difference _javascript skill of obtaining param

Source: Internet
Author: User
Code:
Copy Code code as follows:

<script type= "Text/javascript" ><!--
function SetMode (Newmode)
{
var Text1=document.getelementbyid ("Text1");
var cont;
Btextmode = Newmode;
if (Btextmode) {
cont=text1.innerhtml;
Text1.innertext=cont;
}
else {
Cont=text1.innertext;
Text1.innerhtml=cont;
}
}
--></script>
<body>
<div>
<input id= "EditMode" onclick= "SetMode (this.checked)" type= "checkbox" >
View HTML source code </div>
<div Id=text1 name=text1>
<object width=500 height=300 classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95>
<param Name=filename value=text.mp3>
</object>
</div>

Browse under IE6:

And in the IE7:

IE7 to delete the Param tag in object, which makes us puzzled. When you get object through innerHTML and the HTML code in it, it doesn't simply extract the original code, it's "decorated". The "cosmetic" result in IE6 is that it gives us fairly sophisticated param code, and IE7 deletes param code. This discrepancy has caused a lot of trouble for our web pages to write code. Solution, still in the idea. I would like to have friends who have encountered this problem to discuss together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.