Created
May 8, 2012 03:22
-
-
Save lydonchandra/2632290 to your computer and use it in GitHub Desktop.
Serialize XML to String for IE, Firefox, Chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://gist.github.com/raw/554178/601c25f8ed6e84715dc36804efad915b4a62956d/XMLSerializer.js | |
var xmlString = ''; | |
try { | |
// this works for Firefox, Chrome, Safari | |
xmlString = new XMLSerializer().serializeToString( clickResult ); | |
} catch (e) { | |
// this works for IE6+ | |
xmlString = clickResult.xml; | |
} | |
alert(xmlString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment