function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kenji775Kenji775 

Call API with Javascript only

Hey all,

I am trying to make a call to the Salesforce webservice using only Javascipt. Is it possible? Does anyone have any sample code? I just need to login, and create an object, thats all. Help? Ideas? References?

ArtabusArtabus

If this is from a webpage hosted by salesforce, running in the browser, take a look at the Ajax Toolkit.

If it is from your PC outside of the browser, take a look at the scripting toolkit on Appexchange

Kenji775Kenji775
Its from another website, so I'll have to take a look at the scripting toolkit. Thanks a bunch for the lead!
ArtabusArtabus

If it is from another website, don't try to use the Ajax toolkit as you will be facing cross site scripting issues.

The scripting toolkit won't work neither as it cannot run in the browser.

You will have to develop on the server side, using for instance the php toolkit if your website is running php

Kenji775Kenji775
Oh yeah, totally forgot about XSS issues. I kinda came up with a work around anyway. Thanks everyone.