Answer the question
In order to leave comments, you need to log in
How to get variable from ajax request?
Good time of the day.
Tell me how to pull out a variable from ajax request xml value?
Here is Ajax
$.ajax({
type: "POST",
url: "https://lk.webvm.ru/billmgr?authinfo="+$login+":"+$password+"&out=xml&func=user",
dataType: "xml",
success: function(xml) {
xmlDoc = $.parseXML( xml ),
$xml = $(xmlDoc),
$email = $xml.find("email").text();
alert($email);
},
// если произошла ошибка при получении файла
error: function () {
alert('ERROR');
},
complete: function() {
$('#result').append('<div class="user_info">'+$email+'<div>');
}
});
Answer the question
In order to leave comments, you need to log in
Thank you all! found a solution by typing.
Maybe someone will need it.
$.ajax({
type: "GET",
url: "https://lk.webvm.ru/billmgr?authinfo="+$login+":"+$password+"&out=xml&func=user",
dataType: "xml",
success: function(xml) {
//console.log(xml);
$email = $(xml).find('email').text();
$('#result').append('<div class="user_info">'+$email+'<div>');
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question