Is innerHTML a problem in IE7 ?

M

Manfred

Hi,

When I click any link on this page
http://free.pages.at/staudinger/Regest/Regesten/_A1601-02-08-01657.xml
it only works with IE 6 (and Firefox) but not in IE 7.
I've difficulties to pinpoint the problem (I'm still on win2000 and can

test only occasionally with IE 7) but I suspect it is in the very last
part (copyContent, shown below) of the script (full version at
http://free.pages.at/staudinger/Regest/htmlhttprequest_test.js )

In case of IE I use innerHTML to copy content from a hidden iframe
into a div. Could this be a problem in IE 7 ?

Thank you,

Manfred

//last part of the script:
RemoteFileLoader.prototype.copyContent=function(domDoc,destId){
var src;
divs=domDoc.getElementsByTagName('div');
for (var i=0; i<divs.length; i++) {
if(divs.getAttribute('id')=='xmlbody'){
src=divs;
break;
}
}
alert('copyContent'+'\nsrc '+src+'\ndestId '+destId);
if(src==null){src=domDoc.getElementsByTagNameNS?domDoc.getElementsByTagNameNS(nsXhtml,'body')[0]:(domDoc.getElementsByTagName?domDoc.getElementsByTagName('body')[0]:(domDoc.body?domDoc.body:null))}
var
dest=document.getElementById?document.getElementById(destId):(document.all?document.all[destId]:null);
if(!src||!dest)return;
alert('copyContent'+'\nsrc '+src+'\ndest '+dest);
if(document.implementation.hasFeature("Range","2.0")){
// this is the code for firefox
var range = src.ownerDocument.createRange();
range.selectNodeContents(src);
frag = range.cloneContents();
dest.appendChild(frag);
alert('copyContent'+'\nRange '+'\ndest.innerHTML '+dest.innerHTML);
}
else{
alert('copyContent'+'\ninnerHTML ');
if(src.innerHTML){
// this works fine in IE 6
dest.innerHTML=src.innerHTML;
alert('copyContent'+'\ndest.innerHTML '+dest.innerHTML);
}
}
};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,732
Latest member
ArronPalin

Latest Threads

Top