0

Good evening,

I have a problem getting my code to run on Internet Explorer.

My script has to read an XML file and store the whole formated text (with tagnames, attributes etc etc) within a string. For this procedure I'm using code, like the following

xmlText = $(xml).find("body").html()

The example shows my solution that works quite well in Chrome or Firefox. Internet Explorer has a problem with the .html()-function tho.

I tested the jquery .children()-function aswell, which works, but in my case this function is not an option because I need to check the string xmlText for specific expressions (elements) later.

Do you guys know some workarround here?

1 Answer 1

1

try:

var element = $(xml).find("body").get(0);
var serializer = new XMLSerializer();
xmlText = serializer.serializeToString(element);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.