| View previous topic :: View next topic |
hex4
Joined: 13 Nov 2007 Posts: 17 Location: Qormi, Malta
|
Posted: Tue Jan 08, 2008 6:10 pm Post subject: XML returning an error |
|
|
|
I'm trying to use responseXML in Ajax and an error is showing up.
Basically the error is more in the XML file itself. The & sign is shown as an error. I tried removing the property where the & is and everything worked good.
I'm using ISO-8859-1 as encoding but I even tried UTF-8. Any ideas? _________________ orlandev.com |
|
| Back to top |
|
|
hex4
Joined: 13 Nov 2007 Posts: 17 Location: Qormi, Malta
|
Posted: Tue Jan 08, 2008 6:56 pm Post subject: |
|
|
|
FIXED
looks like the < and & are illegal characters in XML hence what I did was I used regex to replace the & with & in PHP and then re-regexed it back in Javascript
PHP:
| Code: | | echo '<storage>' . ereg_replace('&', '&', mysql_result($result, 0, 'anime_storage')) . '</storage>'; |
Javascript
| Code: | | var storage = xmlObj.getElementsByTagName("storage")[0].childNodes[0].nodeValue.replace(/$amp;/g,'&'); |
_________________ orlandev.com |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
Powered by phpBB © 2001, 2002 phpBB Group |
|
|