I'm having issues in javascript with putting a var that contains xml string into a object and then send it via ajax with jQuery.
The question would be: is it possible to have a xml string into a json object ?
{"a":"a","b":"b", "xml":"<test r='r'></test>"}
Thanks in advance
I'm having issues in javascript with putting a var that contains xml string into a object and then send it via ajax with jQuery.
The question would be: is it possible to have a xml string into a json object ?
{"a":"a","b":"b", "xml":"<test r='r'></test>"}
Thanks in advance
Your XML will be like this:
< test r="r"> </test>
Replace as follows:
& = &
" = "
' = '
< = <
> = >
/ = /
Yes, of course. Your code is working well:
var obj = {"a":"a","b":"b", "xml":"<test r='r'></test>"}
alert(obj.xml)