0

I am still facing the problem of getting the data from the server using the salesforce's REST api. My question is: If I have an URL to the JSON data is it possible to get the data using some specific method on a click event ?

Best regards

1
  • 4
    Welcome StackExchange, can you please help us give you a better answer by providing a little more information. I assume your on a HTML page of some kind, since you mention a click event? Is this Visualforce page or HTML page on a web site you are writing? Some code samples always go a long way. Commented Nov 8, 2013 at 9:04

1 Answer 1

0

Assuming you have run through.

http://www.salesforce.com/us/developer/docs/api_rest/

We use Jquery and click event fired from that.

i.e Something like this.

$.ajax({
  type: "POST",
  url: url,
  data: data,
  success: success,
  dataType: dataType
});

A better example though I could find on the web and showing Salesforce Rest API and Jquery is here. even though it is in a Chrome Extension it shows clearly the process for using REST API with Jquery.

http://www.anupshinde.com/posts/salesforce-rest-api-chrome-extension/

hths

2
  • But jQuery really isn't necessary for a task like this. Accessing the REST API is just as simple in JavaScript, no fuss, no mess. Being that support for non-standard browsers (older IE) is being pulled by Summer '14, feel free to use standard JavaScript that works in accordance to W3C standards.
    – sfdcfox
    Commented Nov 8, 2013 at 15:39
  • @sdcfox Agreed ;) was just using it as example.
    – JamesKn
    Commented Nov 8, 2013 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .