I am accessing a service side function through a javascript button on a visualforce page and I wanted to know; what is a better solution - Javascript Remoting or the AJAX toolkit (consuming a web service).

I have read up and from my understanding Javascript remoting does not affect governor limits, but other than this is a there a reason why you would use one solution over another?

Just trying to brush up on my "best practice" ;)

1 Answer 1


I will prefer Javascript remoting over AJAX toolkit. Main reason is like you mentioned, JSRemoting does not consume API call, where as AJAX toolkit does. But there will be some exceptions, like if you are uploading an attachment from page, Ajax toolkit will help you upload 25MB files, where as in JS remoting it might hit heap limit.

You must log in to answer this question.

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