Skip to content

Instantly share code, notes, and snippets.

@shimy
Created December 17, 2012 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shimy/4318536 to your computer and use it in GitHub Desktop.
Save shimy/4318536 to your computer and use it in GitHub Desktop.
<html>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
url : 'js_backslash_test.xml',
dataType: 'xml',
success : function(xml){
var str = $('test',xml).text();
alert(str);
var str = str.replace(/\\/g,'TEST');
alert(str);
}
})
});
</script>
</body>
</html>
<?xml version="1.0" encoding="utf-8" ?>
<test>te\st</test>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment