Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FireFox Does Not Display Imported XML

Status
Not open for further replies.

mitchkill

Programmer
May 22, 2003
8
US
Guys,
I hope that you all can help me with this. I'm not sure what I am missing, but maybe you guys can give me a little direction.

I have a web app that I am building using AJAX and PHP. It uses several different "dialog boxes" such as a Customer Search box, Item Search box, etc. These dialog boxes are DIV elements that I am importing on the fly from external files so that the user won't have to wait forever for the page to load initially. I am using Sarissa to handle the cross-browser loading of the document.

The current code I have is as follows:


Code:
data = Sarissa.getDomDocument("dialogs/customer_search.php", "data");
data.async = false;
data.load("dialogs/customer_search.php");
document.getElementById('customerSearch').appendChild(document.importNode(data.getElementsByTagName( 'div')[0], true));

Now crazily enough, this works great in IE7. The dialog box opens and displays without any problem. However when I try this in FireFox, it seems like it is only adding the info as XML. It isn't adding it as actual HTML nodes. (Not sure about the terminology here. If I need to explain further, I'll try.) Anyone have any great ideas on how to force Firefox to recognize the node that I am importing as HTML?

Thanks for the help!

Mitchell Killian (II Cor. 12:9)
"Except a man be born again, he cannot enter into the kingdom of heaven." John 3:3
 
Try breaking it down.

get the tagname
import the node
get the element by id
append the child

It is possible one of them hasn't worked but if you bunch it all in one big statement, you'll find it difficult to locate which one it is.
 
Someone in another forum suggested that I add a XMLNS attribute so FireFox knows that it is dealing with XHTML. I added the following attribute to the parent container in my dialog box file:

xmlns="
And now it works as I wanted it to. Thanks for the input, guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top