Ajax Jsonp Cross Domain
Ajax Jsonp Cross Domain
Hi,
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.
thanks
- function checkuser(id){
-
- var res = "";
-
- $.ajax({
- url: "http://cisr.lu/dbsync/checkuser.php",
- type: "GET",
- data: "id="+id,
- async: false,
- dataType: "jsonp",
- success: function(data){
- res = data.success;
- }
- });
-
- return res;
-
- }
- alert("check: "+checkuser("10364"));