Trying to access Salesforce REST API

To access the API in JavaScript you will need to use JWT and your server needs to be able to make/except the cross domain request/response…

https://help.salesforce.com/HTViewHelpDoc?id=remoteaccess_oauth_jwt_flow.htm

Here is more info on jwt (jot).

This type of thing can be a pain in the arse te set-up and sales force (exact target) sucks so good luck.