ChefMo wrote:
Any way to ruin javascript from inside of a .xml file?
(<?xml-script...or the like)
---------------------------------
XML:
---------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
<jscode>alert('Hi from XML');</jscode>
</root>
---------------------------------
javascript
:
---------------------------------
try {
x = new ActiveXObject('Microsoft.XMLDOM');
}
catch(e) {
try {
x = document.implementation.createDocument('', '', null);
}
catch(e) {
alert(e.message);
}
}
if (typeof(x) == 'object') {
x.async = false;
x.load('file.xml');
eval(x.getElementsByTagName('jscode')[0].childNodes[0].nodeValue);
}
---------------------------------
Hope this helps,
--
Bart