{"id":6936,"date":"2014-05-11T17:47:45","date_gmt":"2014-05-11T17:47:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/jsrender-jsviews-how-to-observable-insert-to-object-inner-array-collection-of-common-programming-errors\/"},"modified":"2014-05-11T17:47:45","modified_gmt":"2014-05-11T17:47:45","slug":"jsrender-jsviews-how-to-observable-insert-to-object-inner-array-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/jsrender-jsviews-how-to-observable-insert-to-object-inner-array-collection-of-common-programming-errors\/","title":{"rendered":"JsRender+ JsViews | How to $.observable().insert to object inner array-Collection of common programming errors"},"content":{"rendered":"<p>Sample JSON: https:\/\/gist.github.com\/mekkoo\/6604902<\/p>\n<p>I want using $.observable().insert method to object inner array &#8220;items&#8221;. but, I looked error &#8220;Uncaught TypeError: Object # has no method &#8216;insert'&#8221; when method calling<\/p>\n<pre><code>pages = \/\/Sample JSON $.ajax calling\n$.observable(pages).insert(pages.length, {\n    \/\/I want this data to insert to \"items\" array\n    \"item\": {\n        \"id\":  3,\n        \"item_name\": \"Item Name 3\",\n        \"item_desc\": \"Item Desc 3\",\n        \"item_img\": \"http:\/\/example.com\/sample.png\"\n    },\n    \"values\": [\n        {\n            \"id\": 0,\n            \"key_id\": 0,\n            \"value\": \"Value 0\"\n        },\n        {\n            \"id\": 1,\n            \"key_id\": 1,\n            \"value\": \"Value 1\"\n        },\n        {\n            \"id\": 2,\n            \"key_id\": 2,\n            \"value\": \"Value 2\"\n        }\n    ]\n});\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sample JSON: https:\/\/gist.github.com\/mekkoo\/6604902 I want using $.observable().insert method to object inner array &#8220;items&#8221;. but, I looked error &#8220;Uncaught TypeError: Object # has no method &#8216;insert&#8217;&#8221; when method calling pages = \/\/Sample JSON $.ajax calling $.observable(pages).insert(pages.length, { \/\/I want this data to insert to &#8220;items&#8221; array &#8220;item&#8221;: { &#8220;id&#8221;: 3, &#8220;item_name&#8221;: &#8220;Item Name 3&#8221;, &#8220;item_desc&#8221;: &#8220;Item [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6936","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6936"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6936\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}