If you want to retrieve records from Dynamics CRM using JavaScript you will need SDK.REST.js library which you can find in your SDK install location. SDK.REST is a reusable, generic library that simplifies asynchronous data operations using the REST Endpoint for web resources. In following example, we will demonstrate how to use retrieveMultipleRecords function to retrieve your Contacts. Click here to read more.