I\'ve done some jQuery in the past, but I am completely stuck on this. I know about the pros and cons of using synchronous ajax calls, but here it will be required.
how remote is that url ? is it from the same domain ? the code looks okay
try this
$.ajaxSetup({async:false}); $.get(remote_url, function(data) { remote = data; }); // or remote = $.get(remote_url).responseText;