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

  • 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. Nov 8, 2013 at 9:04

1 Answer 1


Assuming you have run through.


We use Jquery and click event fired from that.

i.e Something like this.

  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.



  • 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
    Nov 8, 2013 at 15:39
  • @sdcfox Agreed ;) was just using it as example.
    – JamesKn
    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 .