从具有相同组件的函数中反应Js调用函数

时间:2016-11-02 09:42:25

标签: javascript jquery reactjs

startserver函数如何调用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() { 

//我想调用searchawsinfo函数。                                                 self.searchawsinfo; //我想调用searchawsinfo函数。

                                    }


                    });
},

searchawsinfo : function(){
// it should be called from startserver function , i guess i am missing something
},

2 个答案:

答案 0 :(得分:0)

self.searchawsinfo();将用来代替self.searchawsinfo;

答案 1 :(得分:-1)

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
},