[Javascript] dom/javascript question regarding Internet Explorer

Peter Brunone peter at brunone.com
Fri Jul 20 08:39:51 CDT 2007


Hi Lee,

    In cases like this, I always ask "what part doesn't work?" since the point of failure will usually help you (or us) to isolate the difference between the browsers.  Can you get a bit more data on which line it is at which things go wrong?  An error message would be one way to identify this point; another would be a debugger (you can download the IE Script Debugger from MS though it doesn't always help), and a third would be the old-fashioned brute-force method of using alert, window.status, or document.write to show what data you have so far.

Cheers,

Peter

----------------------------------------

From: "Lee Bettridge" <lbettridge at twowaytv.co.uk>
Sent: Friday, July 20, 2007 2:59 AM
To: "[JavaScript List]" <javascript at LaTech.edu>
Subject: [Javascript] dom/javascript question regarding Internet Explorer 

I want to copy the contents of the tag in an html
document and write this elsewhere in the doc when it loads.
The following works in Firefox but not in ie, could anyone point out why
and maybe suggest an alternative please.

HTML

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

JAVASCRIPT

var title = document.getElementsByTagName("TITLE").item(0);
var str_title = title.firstChild.data;

var obj = document.getElementById("document_header");
while(obj.hasChildNodes()) obj.removeChild(obj.childNodes[0]);
obj.appendChild(document.createTextNode(str_title));
________________________________________________________
Two Way TV is the trading name of Two Way Media Ltd
Company Number: 4904168
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070720/ae858a74/attachment.htm>


More information about the Javascript mailing list