0
   

convert the jquery ajax to native javasctipts

 
 
Reply Sat 17 Oct, 2015 12:40 pm
here is my ajax function i want to convert it to the native JavaScript please help me if any one know
ajax.updateErrorLog = {
setup: function(command, data) {


var attributes = ajaxHandler.defaultAttributes;
attributes.url = 'index.php/request/' + command.toLowerCase();
attributes.data = data;
attributes.type = 'POST';
attributes.success = this.success,
attributes.error = (this.error) ? this.error : attributes.error,
ajaxHandler.sendRequest(attributes);
},
success: function(data) {

}
}

here is the ajaxHandler method

ajaxHandler = {
defaultAttributes: {
type: 'GET',
url: 'index.php/request',
datatype: 'json',
data: {},
success: null,
error: function(data) {
errorHandler.showError('An Error occurred while trying to retreive your requested data, Please try again...');
},
timeout: function() {
errorHandler.showError('The request has been timed out, Please check your Internet connection and try again...');
}
},
sendRequest: function(attributes) {
Paper.giffyLoading.style.display = 'block';
// Program.status('Generating Network Request...');
if (!attributes.nopopup) {
if (attributes.loadmsg) {
Controllers.AnimationController.createProgressBarScreen(attributes.loadmsg);
attributes.loadmsg = null;
}
// else
// Interfaces.AdvancePopup.createModalPopupLoadingDiv();
}
$.ajax(attributes);
}
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 478 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » convert the jquery ajax to native javasctipts
Copyright © 2019 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/25/2019 at 11:49:47