locked
Using JQuery Ajax functions to retrieve data from the server RRS feed

  • Question

  • Hi ,

    I have server url ,using that i am trying to get the data .but unable to get .

    please find below code.

    function GetRecords(url) {
         $.ajax({
             type: "GET",
             url: url,
             data: "{}",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             success: OnSuccess,
             error: OnError
         });

     }
     function OnSuccess(data, status) {
         if (data && data.d != null && data.d.results != null) {
                  AddRecordsToArray(data.d.results);
          }
     }

     function OnError(request, status, error) {
         alert("Error :  has occured during retrieval of the records ");
     }
    function AddRecordsToArray(records) {
         for (var i = 0; i < records.length; i++) {
             Test.push(records[i].Name);

         }
     }

    Tuesday, January 24, 2017 9:25 AM

All replies

  • Hi 

    Check this and this

     Hope this helps.

    Thanks

    Tuesday, January 24, 2017 9:50 AM
  • I have server url in IIS ,from that i am trying to get the data.

    Let me explain .I have create html page in section .we have one drop down list .For that I am trying to append values using service[iis].

    but I am unable to get the data.

    Tuesday, January 24, 2017 9:57 AM
  • Confirm that url is working. Can you paste url. 

    Tuesday, January 24, 2017 11:13 AM
  • it is working  in browser , .but when i am trying to get using ajax ,I am getting this error "status code is:0 and error: access is denied 

    Tuesday, January 24, 2017 11:22 AM
  • Are you using this JS code from CRM WebResource?

    MaKeer | <a href="http://wp.me/1AkRL" target="_blank">myencounterwithcrm.wordpress.com</a>

    Sunday, February 5, 2017 3:28 AM