javascript - XMLDOM "undefined is not a function" alert Chrome -
i tried open xml file chrome gives me alert saying "undefined not function" , nothing more. don't know problem. can please tell me problem , how can solve it?
my code:
<!doctype html> <html> <head> </head> <body> <script> function loadxmldoc(dname) { 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)} } try { xmldoc.async=false; xmldoc.load(dname); return(xmldoc); } catch(e) {alert(e.message)} return(null); } var xmldoc= loadxmldoc('skoly.xml'); </script> </body> </html>
your document.implementation.createdocument invalid. here documentation on it: https://developer.mozilla.org/en-us/docs/web/api/domimplementation.createdocument
Comments
Post a Comment