Created
May 20, 2013 18:35
-
-
Save SpencerCooley/5614260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ajaxStuff1(value){ | |
//do some ajax stuff with a value with a value parameter | |
} | |
function ajaxStuff2(value){ | |
//do some other ajax stuff with a value parameter | |
} | |
var doStuffWhenSelectIsChanged = function(theId, ajaxStuff){ | |
$(theId).change(function(){ | |
var theValue = $(theId).val(); | |
//do some ajax stuff with access to 'theValue' variable here. | |
ajaxStuff(theValue) | |
}); | |
} | |
doStuffWhenSelectIsChanged('#lang1', ajaxStuff1) | |
doStuffWhenSelectIsChanged('#lang2', ajaxStuff2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment