Hi i've two wordpress sites in various domain names, and i wish to pass some values in one with other with ajax ... and makes it ..

Despite the fact that the url is working, basically place this url into address bar it really works not surprisingly everyrthing is performed and showing however when i attempt to request it via ajax i recieve that error (GET http://www.site.dk/?userid=admin&pass=admin 302 Found)

<script type="text/javascript">
$(document).ready(function() {
    // $.post("http://www.site.dk/index.php", { userid: "<?php echo $_REQUEST['userid'] ?>", pass: "<?php echo $_REQUEST['pass'] ?>" } );
    $.getJSON("http://www.site.dk/?userid=<?php echo $_REQUEST['userid'] ?>&pass=<?php echo $_REQUEST['pass'] ?>");
          var dataString = 'userid='+'<?php echo $_REQUEST['userid'] ?>'+'&pass='+'<?php echo $_REQUEST['pass'] ?>'+'';  
      type: "POST",  
      url: "http://www.site.dk/",  
      data: dataString,  
      success: function() {}  
    return false;  


I've attempted and to change url to not real url but to tempalte file url, then getting 500 Internal server error.

And that i have attempted three various ways, without results any ideas ?


You can't make an ajax call to a different domain. To create AJAX calls, domain / port must match.

You will find two ways for this:

1) Make an ajax call towards the domain you are on &lifier create a GET call out of your domain for your second domain.

2) Use JSONP to transfer data in one domain to a different.

Also, you appear to become posting some user/password qualifications to Javascript, that's not recommended as everybody can easily see them.