Iekaa Emi
asked on
How to read an XML file from FTP
I have task that need me to read an xml file that has been given to me. I've made some research, unfortunately I didn't find one that suit with my needs. I am using javascript to read the xml file. Is there any ways on how can I read the xml file using ftp? Your help is greatly appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the url is giving error? What do you mean?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi expert,
The url given can be reach now. Could you help me?
The url given can be reach now. Could you help me?
https://jsfiddle.net/c3mdqw08/
<textarea id=xml cols=80 rows=12></textarea>
$("#xml").load("http://ukhwah.dyndns.org:8080/cmlms/js/cust_status.xml",
function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#xml").html("ERROR!" + "\n" + msg + xhr.status + " " + xhr.statusText);
}
}
);
ASKER
var msg = "Sorry but there was an error: ";
Is it same like alert function?
Is it same like alert function?
ASKER
Could you explain? i do not understand.
this demo does not work on jsFiddle, but may work on your web server...
msg is just a variable name... in case of any issue, it will put
into textarea instead of xml...
you can remove this (ignore error/error code)
and just show a message
in case of any error...
msg is just a variable name... in case of any issue, it will put
ERROR!
Sorry but there was an error: 0 error
into textarea instead of xml...
you can remove this (ignore error/error code)
var msg = "Sorry but there was an error: ";
$("#xml").html("ERROR!" + "\n" + msg + xhr.status + " " + xhr.statusText);
and just show a message
var msg = "Ooops! Could not load data!";
alert(msg);
in case of any error...
ASKER
this is the address >> http://ukhwah.dyndns.org:8080/cmlms/js/cust_status.xml