Answer the question
In order to leave comments, you need to log in
How to check ajax connection and request by login and password?
Good time of the day.
Tell me how to check the ajax connection request by login and password getting xml data?
Here is the xml response from the server
<doc lang="ru" func="user">
<elem>
<self>on</self>
<default_access_allow>on</default_access_allow>
<account_id>5173</account_id>
<enabled>on</enabled>
<email>[email protected]</email>
<realname>Галимов Олег</realname>
<name>[email protected]</name>
<id>5176</id>
</elem>
<tparams>
<out>xml</out>
<func>user</func>
</tparams>
<saved_filters/>
</doc>
$(function() {
$('.bill_botton').click(function() {
var login = $('#authLogin').val();
var password = $('#authPassword').val();
$.ajax({
type: "POST",
url: 'https://lk.webvm.ru/billmgr?authinfo="'+login+'":"'+password+'"&out=xml&func=user',
dataType: "xml",
success: function(data){
$(data).find('elem').each(function(){
var xmlEmail = $(this).find('email').text();
});
alert (xmlEmail);
},
// если произошла ошибка при получении файла
error: function(){
alert('ERROR');
}
});
});
});
Answer the question
In order to leave comments, you need to log in
$(function () {
$('.bill_botton').click(function () {
var login = $('#authLogin').val();
var password = $('#authPassword').val();
$.ajax({
type: "POST",
url: 'https://lk.webvm.ru/billmgr?authinfo="' + login + '":"' + password + '"&out=xml&func=user',
dataType: "xml",
success: function (data) {
var xmlDoc = $.parseXML(data),
xml = $(xmlDoc),
xmlEmail = xml.find("email");
alert(xmlEmail);
},
// если произошла ошибка при получении файла
error: function () {
alert('ERROR');
}
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question