I have the following two event happening when my "export" url is clicked. No matter how I try, I can't combine the two without receiving a "hey, you're missing a comma or semicolon somewhere"-error. Can anybody suggest a way to combine the two, or should I just leave them separate as they are now?
$('#export').click(function() {
$.each(gSelectedMeds,
function(intIndex, objValue) {
i=intIndex + 1;
if(i>1) {string+='&';}
string+='med'+i+'="'+objValue+'"';
}
)
string += "&count="+i;
});
$('#export').click(function(){
$.ajax({
url: 'ajax-exportMeds.php?'+string,
type: "GET",
dataType: "text",
success:
function(data){
$('#dialog_layer').dialog({
autoOpen: true,
bgiframe: true,
modal: true,
buttons: {
"OK":
function() {
$(this).dialog("close");
}
}
})
}
})
});