Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myFunct(settings, callback){
- if(!callback)return;
- var x = 100;
- //here is where i have issues, as i want
- //to be able to adjust the success function
- // to also have 1 line of code, a decrementer.
- //I want to do something like settings.success = "x--;" + settings.success;
- callback(settings);
- //I also wasnt sure if you could wrap 'callback'
- //with a success function when the inner success function executes
- }
- var settings = "";//settings of the ajax call.
- myFunct(settings, function(x){ $.ajax(x);});
- function myFunct( settings, callback ) {
- if (!callback) return;
- var x = 100;
- callback(settings).done(function(){
- x--;
- });
- }
- var settings = { url: "foobar.php" };
- myFunct( settings, function(x) {
- return $.ajax(x);
- })
Add Comment
Please, Sign In to add comment