Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
ie7 xml ActiveXObject ErrorMessage: Object expected
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="JTree, post: 4948970"] Hi all, My System is windows and ie version is 7. My code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javsscript"> <!-- var xmlDoc; function LoadXml(){ if (Web.Application.get_type() == Web.ApplicationType.InternetExplorer) { var progIDs = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.5.0', 'Msxml2.DOMDocument.4.0', 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ]; for (var i = 0; i < progIDs.length; i++) { try { xmlDOM = new ActiveXObject(progIDs[i]); return xmlDoc; } catch (ex) { alert("ex.message"); } } return null; } } function ProcessXml(){ if (window.ActiveXObject){ try{ //xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0"); LoadXml(); xmlDoc.async = false; xmlDoc.load("url.xml"); } catch(e) { alart(e.message); } } else if (document.implementation && document.implementation.createDocument){ xmlDoc = document.implementation.createDocument("", "" , null); xmlDoc.load("url.xml"); //xmlDoc.onload = ShowXml; } else { alert("your browser cannot handle the script!"); } ShowXml(); } function ShowXml(){ //alert(xmlDoc.getElementsByTagName("url") [0].childNodes[0].nodeValue); } --> </script> </head> <body> <form action="#"> <input type="button" name="process" id="process" onclick="ProcessXml()" /> </form> </body> </html> url.xml: <?xml version="1.0" encoding="utf-8" ?> <urls> <url> <obj>1</obj> <priority>1</priority> <loop>3</loop> </url> <url> <obj>1</obj> <priority>2</priority> <loop>3</loop> </url> <url> <obj>1</obj> <priority>3</priority> <loop>3</loop> </url> </urls> When I click the button, the ie shows an error message "Object expected". Is there any problem with my code? Any suggestions would be appreciated! Thanks![/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
ie7 xml ActiveXObject ErrorMessage: Object expected
Top