Abbas Khoja Abbas Khoja - 1 month ago 9
jQuery Question

React Js Call function from a function with same component

start server should be calling searchaws info

startserver : function(){
var self =this;
$.ajax({
type: "POST",
url: "",enter code here
data: JSON.stringify(amazonEc2ManagerBean),
contentType: "application/json",
dataType: 'json',
success: function() {
self.searchawsinfo(); // i want to call searchawsinfo function.

}


});
},

searchawsinfo : function(){
// it should be called from startserver function
},

Answer
function(){ 
          var self = this; 
          $.ajax({ type: "POST", url: "",enter code here
          data: JSON.stringify(amazonEc2ManagerBean), 
          contentType: "application/json", 
          dataType: 'json', 
          success: function() { 
                               self.searchawsinfo(); // i want to call searchawsinfo function.
                               }
 });
},

searchawsinfo : function(){
 // it should be called from startserver function
},