In SharePoint 2010 you can use the "content link" property of a Content Editor web part to link to an HTML file that contains your embedded script.
The constructors, methods, and properties of all objects found in the
SP namespace are documented in the SharePoint 2013 client object model reference here.
JSOM's Asynchronous Programming Pattern
ClientContextobject to retrieve objects representing entities in the SharePoint object model, such as lists, folder, views.
loadfunction to tell the
ClientContextwhat information you want to receive back from the server.
executeQueryAsyncfunction to send the queued instructions to the server, passing two callback functions to run on success or failure.