J
JTree
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);
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!
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);
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!