I can't pass different values of variable through $.get() function please check this code to learn more about my problem
var addressFieldValues = ['address1', 'address2', 'address3'];
for(i=0; i<addressFieldValues.length; i++) {
var address = addressFieldValues[i];
$.get('function.php', address, function(data){
alert(address); // alerts address1 all time
});
}
Why is it alerting "address1" these 3 times? since it should alert 3 different addresses at all.