title: Get listitem using jquery or javascript from Office 365(Sharepoint Online)?
body: <p>there are good solutions to get data from office 365, and move it to another platform using client object model.. i.e <a href="http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx" rel="nofollow">Wictor Wilen</a> solution. its work in code behind.</p>
  
  <p>i have tried to get list data from office 365, to another platform like azure project(html page).
  i did try to using <code>.asmx</code> webservices. that works perfectly in Office 365 Site page. but when script swift to any other html page(azure project). its not working.i have passed credentials even if they are not working. Here is my script.</p>
  
  <pre><code> function GetData()
   {
  
      var soapEnv =
          "&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt;&lt;soapenv:Body&gt;&lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt;&lt;listName&gt;Cloud&lt;/listName&gt;&lt;query&gt;&lt;Query&gt;&lt;/Query&gt;&lt;/query&gt; \
                       &lt;viewFields&gt; \
                          &lt;ViewFields&gt; \
                             &lt;FieldRef Name='OfficeCountry' /&gt; \
                             &lt;FieldRef Name='Title' /&gt; \
                         &lt;/ViewFields&gt; \
                      &lt;/viewFields&gt; \
                  &lt;/GetListItems&gt; \
              &lt;/soapenv:Body&gt; \
          &lt;/soapenv:Envelope&gt;";
  
      $.ajax({
          url: "https://nexpo.sharepoint.com/_vti_bin/lists.asmx",
          type: "POST",
          dataType: "xml",
          data: soapEnv,
          processData: false,
         beforeSend : function(req) {
           req.setRequestHeader('Authorization', 
                 make_base_auth ('username', 'pwd'));
      },
          complete: processResult,
          contentType: "text/xml; charset=\"utf-8\""
      });
    }
   function processResult(xData, status) {
  
      $(xData.responseXML).find("z\\:row").each(function() {
  
         var lititle=  $(this).attr("ows_Title");            
         alert(lititle);
  
      });
    }
  
   function make_base_auth(user, password) {
     var tok = user + ':' + password;
     var hash = Base64.encode(tok);
     return "Basic " + hash;
   }
  </code></pre>
  
  <p>it may be becauses of a cross domain problem. but is this possible to do this in this manner? 
  does anyone have a better solution or idea to retrive the data?</p>