edit-task
Home
Up
Delete
Task Name:
Task Description:
#### - JSON.stringify and JSON.parse - work with
TaskGroup ID:
Start Date:
Start Time:
Duration:
Priority:
Status:
To Do
Completed
In Process
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">title</h1> <h2>[previously]</h2> <ol> <li>]</li> </ol> <p> </p> <h2>[currently]</h2> <ol> <li><span style="background-color: #ffffff;"><strong>*] JSON.stringify(obj) creates a beautiful json object literal</strong></span></li> <ol> <li><span style="background-color: #ffffff;">] ?= how to unpack it on the recieving end, JSON.parse(myObject)</span></li> <li><span style="background-color: #ffffff;">] PRB = throws error, ??</span></li> <li><span style="background-color: #ffffff;">] TRY = myObject[0].id</span></li> </ol> <li><span style="background-color: #ffffff;"><strong>] output is array, we need to use array index when passing the data</strong></span></li> <ol> <li><span style="background-color: #ffffff;">] ex - passing menu:mainMenu = fail, PASS menu:mainMenu[0] WORKS</span></li> </ol> <li><span style="background-color: #ffffff;"><strong>] TRY - use {}, not [] to define json literals, they can then be passed </strong></span></li> <ol> <li><span style="background-color: #ffffff;">] hunky dory</span></li> </ol></ol> <p> </p> <hr /> <p> </p> <p> </p> <ol> <li><span style="background-color: #ffffff;"><strong>] add script to jade view template</strong></span></li> <ol> <li><span style="background-color: #ffffff;">] inline with script. tag</span></li> <li><span style="background-color: #ffffff;">] insert link into head section using #block </span></li> </ol> <li><span style="background-color: #ffffff;"><strong>] jade views</strong> and </span></li> <ol> <li>// script.</li> <li>// inline script cant access any var PASSED into page by route</li> <li> alert(=dname);</li> <li> // can call script</li> <li> // test();</li> <li> // lookupDriver(=drivers[6].name); // lookup(2);</li> </ol></ol> <h2>[next]</h2> <ol> <li>]</li> </ol> <p> </p> <p> </p> <p>x] How to find index of an itex in JavaScript Object Array Dhananjay Kumar</p> <p>] <a href="http://adripofjavascript.com/blog/drips/filtering-arrays-with-array-filter.html">http://adripofjavascript.com/blog/drips/filtering-arrays-with-array-filter.html</a> </p> <p> - beautiful, simple example of using filter</p> <p>- * filter doesnt work in older browsers (<= ie8 )</p> <p>- TRY = map and sort()</p> <p>filter array javascript</p> <p><a href="https://egghead.io/lessons/javascript-chaining-the-array-map-and-filter-methods" target="_blank">https://egghead.io/lessons/javascript-chaining-the-array-map-and-filter-methods</a></p> <p>- VAR example - filter on multiple elements</p> <p><a href="http://stackoverflow.com/questions/2722159/javascript-how-to-filter-object-array-based-on-attributes">http://stackoverflow.com/questions/2722159/javascript-how-to-filter-object-array-based-on-attributes</a> </p> <p> </p> <p> </p>