GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — fullstack-javascript/code/03-parse-sdk/app.js at master · Alqoseemi/fullstack-javascript Expand file tree/ Copy pathapp.jsMore file actions 45 lines (39 loc) · 1.16 KB / Copy pathapp.jsFile metadata and controls45 lines (39 loc) · 1.16 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 $(document).ready(function() { // You define them when you start the Parse server const parseApplicationId = 'APPLICATION_ID' const parseJavaScriptKey = 'MASTER_KEY' Parse.initialize(parseApplicationId, parseJavaScriptKey) Parse.serverURL = 'http://localhost:1337/parse' const Test = Parse.Object.extend('Test') const test = new Test() const query = new Parse.Query(Test) $('.btn-save').click(function(){ let data try { data = JSON.parse($('textarea').val()) } catch (e) { alert('Invalid JSON') } if (!data) return false test.save(data, { success: (result) => { console.log('Parse.com object is saved: ', result) $('.log').html(JSON.stringify(result, null, 2)) //alternatively you could use alert('Parse object is saved') }, error: (error) => { console.log(`Error! Parse.com object is not saved: ${error}`) } }) }) $('.btn-get').click(function(){ query.find({ success: function(results) { $('.log').html(JSON.stringify(results, null, 2)) }, error: function(error) { alert(`Error: ${error.code} ${error.message}`) } }) }) }) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |