You need to know how to use the Sharepoint client object model. Firstly, you have to get the SP ContentContext -> SP SP List -> SP ListItems.
Here is the complete basic operations using Javascript libraryJavaScript Object Model code in SP. I think that will be really helpful for you: http://msdn.microsoft.com/en-us/library/office/jj163201.aspx