- : ~ line 14 we load script called CloudAPI from Primus API, just like we load jQuery.
- : ~ line 18 we make an instance of the CloudAPI, cAPI = new CloudAPI(…). This is where you type in your app key that you got from PrimusAPI signup.
- : ~ line 28 we call the insert(…) function, on click. We pass it the table name, the columns and a call back.
- : ~ line 31is the callback, it displays in the console the new primary key of the row just inserted.
You should see your app name. Click it.
You should see the table name (‘namepp’). Click it.
That should show you the name you just inserted. Go ahead an insert another name using the local html file and bowser and go back to ‘Primus Data View’ to see all the records you are inserting.
- ~ line 26 we load a jQuery binding library. There are many, this is one of them.
- ~ it will bind (in the next step) to line ~ 20. That is the mark up in how it will display, you can change that.
- ~ line 50 we call the select API, pass it null. It means that there is no ‘where’ clause, give us all the records. You could create an object and set column to something.
- ~ line 54 is where you show the returned rows to the development console.
Note so far, we did not use any back end resources (i.e. PHP. ASP. JSP. Ruby. Python). 0!