Ajax Jsonp Cross Domain

Ajax Jsonp Cross Domain


I'm writing the following function to check on an other server if an user in a db exist or not. Unfortunately my function isn't working. I googled a lot but couldn't find an solution. Ofter i read i have to user async:false but i used this from the beginning. Has anyone an idea how i could implement this right?

When i to an alert on the end of my function, i'll get a result, otherwise i don't get an return value.


  1. function checkuser(id){
  3.     var res = "";
  5.     $.ajax({
  6.         url: "http://cisr.lu/dbsync/checkuser.php",
  7.         type: "GET",
  8.         data: "id="+id,
  9.         async: false,
  10.         dataType: "jsonp",
  11.         success: function(data){
  12.             res = data.success;
  13.         }
  14.     });
  16.     return res;
  18. }
  19. alert("check: "+checkuser("10364"));