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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -