XMLHttpRequest Error while using Drupal "Services"
===

I know the question was asked several times before and I know why I get the *XMLHttpRequest Error* because of **cross domain** issues but my Problem is how to fix it and unfortunately I found nothing by using google for 3 days.  

**Case:** Since days I try to connect my phoneGap app or just a testing page to an existing Drupal site.

**What I did so far:**  
- I already installed all required modules like *Services* and *REST* Server.  
- I added a *REST* Server and edited all resources.  
- By calling my_web_page/endpoint/node.json I reach the *node.json* file  
- With the poster plugin for firefox I could test all requests and resources like user/login, system/connecct or user/create so everything works.  
- Now I need to get this data into my own test page by using javascript.  
- I was looking for some examples, tutorials or any help I found some but nothing worked for me.  
- I also tried to use a .php file to do the request and call it external but you can't just call a php file in drupal or I don't know how.  
- If I store the JavaScript file on the same server where drupal is stored and call it from there everything workes but if I call the same JavaScript File stored on the Server by adding it to my index.html I get the XMLHttpRequest as well.  
- The JavaScript Code I'm using which causes the XMLHttpRequest Error:  

  

        var name = 'username';
        var pass = 'password';
    
      // BEGIN: drupal services user login (warning: don't use https if you don't have ssl setup)
      $.ajax({
          url: "http://mypage.de/?q=endpoint/user/login.json",
          type: 'post',
          data: 'username=' + encodeURIComponent(name) + '&password=' + encodeURIComponent(pass),
          dataType: 'application/json',
          jsonp: 'jsonp_callback',
          error: function(XMLHttpRequest, textStatus, errorThrown) {
            alert('page_login_submit - failed to login');
            console.log(JSON.stringify(XMLHttpRequest));
            console.log(JSON.stringify(textStatus));
            console.log(JSON.stringify(errorThrown));
          },
          success: function (data) {
           alert('success');
          }
      });
      // END: drupal services user login
      return false;  
Now I have no Idea how to get the data in my own app or what to search for.  

I hope somebody has an advice, tutorial or can help me.  

Thanks in advance - yves