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
BBurkleBBurkle 

General approach for Java Script Web App on Force.com Site?

What is the general approach for having a force.com site host a JavaScript web app which communicates with the Salesforce via REST API?  Would I zip up the JavaScript, HTML and CSS files, upload them as a resource, then point to the main HTML file from a visual force page which is in the site?  What documentation would be good to read for this situation?

 

Thanks!

 

 

Best Answer chosen by Admin (Salesforce Developers) 

All Answers

sfdcfoxsfdcfox

Static Resources require authentication (as far as I've observed). Instead, consider inlining the resources, hosting them on Content or the Documents tab, or on an external server.

sfdcfoxsfdcfox

Thanks for that information. I obviously missed it, so it's nice to know that it does work.

BBurkleBBurkle

Thank you for the information.  I found this doc a few days ago and it did answer my questions.  

 

The Javascript toolkit makes this kind of development possible, but there are a couple things which would make development a little easier.

1.  Direct communication with the REST API would allow the use of outside tools which understand a REST api.

2.  I want to write as little Visualforce code as possible.  This solution seems to assume that a Visualforce page is the starting point.  

I was hoping that if I hosted my app on force.com and was accessing force.com data, that development would go smoother.