Click here to Skip to main content
15,562,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to use ajax to call my web services.

URL:

http://www.smartcloudlearning.mobi/SmartCloudLearningMobi/rest/resource/getResourceTypes

Try this URL with Rest client Jar

Method = GET
Key = accept
value = Application/json

Can anyone help me out to call the above link by ajax method.

I have spend nearly 2 days but of no use..

Any help will be appreciated...


Regards
Karthick
Posted

Hi Karthick,

I don't know where are you using this as you haven't explained. Hoping you are using this on the asp/jsp page you can call the web service in following way:


function myWebServiceCall() {
$.ajax({
type: "GET",
url :"http://www.smartcloudlearning.mobi/SmartCloudLearningMobi/rest/resource/getResourceTypes",
dataType: "text",
success: function(data){
// use the returned output(data) from web service

}
});
}

call this function myWebServiceCall, when required.

Thanks,
Jyotish
 
Share this answer
 
Shorthand Ajax function:

JavaScript
$(document).ready(function () {

   jQuery.support.cors = true; /*Allow cross domain calls*/ 
   

 $.getJSON("http://www.smartcloudlearning.mobi/SmartCloudLearningMobi/rest/resource/getResourceTypes", function (data) {
    alert(data);
    });
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900