I've got the following function:
function postToDrupal(contacts, source, owner) {
(function ($) {
$.post("/cloudsponge-post",function(contacts) {
alert(contacts);
});
}(jQuery));
}
The problem I'm having is, contacts seems to be defined outside the jQuery closure, but not inside it. I'm a javascript newbie so this is confusing me. How can I get this to post contacts?