Hello there,
I am writing a plugin for the FCKEDITOR and everything works fine but I would like to have the plugin read from an XML file which should be in the same directory as the fckplugin.js file ...
However, this doesn't seem to work even though the file tags.xml does exist , alert(elements.length) returns 0 even though it should return 2 ..
Any ideas on what's happening ?
I am writing a plugin for the FCKEDITOR and everything works fine but I would like to have the plugin read from an XML file which should be in the same directory as the fckplugin.js file ...
function readFromXML() { try //Internet Explorer { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } catch(e) { try //Firefox, Mozilla, Opera, etc. { xmlDoc=document.implementation.createDocument("","",null); } catch(e) { alert(e.message); return; } } try { xmlDoc.async=false; xmlDoc.load('tags.xml'); var elements = xmlDoc.getElementsByTagName( 'tags' ) ; alert(elements.length); } catch(e) { alert(e.message); } }
However, this doesn't seem to work even though the file tags.xml does exist , alert(elements.length) returns 0 even though it should return 2 ..
Any ideas on what's happening ?
Re: plugin reads from xml file ?
the line
should really be:
because JavaScript does not seem to have access to the server-side files in the same way that PHP does ...