{"id":1411,"date":"2022-08-30T15:16:18","date_gmt":"2022-08-30T15:16:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/15\/jquery-list-view-to-load-json-data-is-not-working-please-help-me-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:18","modified_gmt":"2022-08-30T15:16:18","slug":"jquery-list-view-to-load-json-data-is-not-working-please-help-me-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-list-view-to-load-json-data-is-not-working-please-help-me-collection-of-common-programming-errors\/","title":{"rendered":"jquery list view to load json data is not working please help me-Collection of common programming errors"},"content":{"rendered":"<p>jquery mobile list view to load json data is not working please help me<\/p>\n<p>i am created php code to ganerate json file, i am trying load that json data to my jquery mobile list view but it is not loading<\/p>\n<p>crome console error is: &#8220;Uncaught ReferenceError: json is not defined &#8220;<\/p>\n<p>please solve this<\/p>\n<p>my jquery mobile index.html code is<\/p>\n<pre><code>    \n\n\n    \n\n    \n    View Source\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n        <\/code><\/pre>\n<h1><code>Categories<\/code><\/h1>\n<pre>\n    \n       \n        <\/pre>\n<ul id=\"list\" data-role=\"listview\"><\/ul>\n<pre>       \n    \n\n\n     \n\n            $(document).on('pagebeforeshow', '#cat', function(){ \n\n\n                var url=\"http:\/\/localhost:8888\/coupns\/index.php\";\n\n                $.getJSON(url,function( data ){\n                    \/\/loop through deals\n                    $.each(json.posts,function(i,dat){\n                        $(\"#list\").append(\"<\/pre>\n<li><code><b>ID:<\/b> \"+dat.id+ \" <b>Name:<\/b> \"+dat.shop+ \" <b>Description:<\/b> \"+dat.dec+ \" <b>Limit:<\/b> \"+dat.cat+ \" <b>Rest ID<\/b> \"+dat.expdate+ \"<\/code><\/li>\n<pre>\");\n                     });\n                     $(\"#list\").listview('refresh');\n                });\n             });\n        \n\n\n\n          \n    \n        <\/pre>\n<ul>\n<li><code>Categories<\/code><\/li>\n<li><code>By Shop<\/code><\/li>\n<\/ul>\n<pre>\n    \n\n\n\n\n\n\n\n\n\n\n\n    \n        <\/pre>\n<h1><code>By Shop<\/code><\/h1>\n<pre>\n    \n       \n        <\/pre>\n<ul data-role=\"listview\">\n<li><code>Page Two<\/code><\/li>\n<\/ul>\n<pre>       \n    \n\n          \n    \n        <\/pre>\n<ul>\n<li><code>Categories<\/code><\/li>\n<li><code>By Shop<\/code><\/li>\n<\/ul>\n<pre>\n    \n\n\n\n\n\n\n<\/pre>\n<p><code>my php json encode code is<\/code><\/p>\n<pre><code><code> \n<\/code><\/code><\/pre>\n<p>my json data out put is is<\/p>\n<pre><code>{\"posts\":[{\"post\":{\"id\":\"1\",\"shop\":\"ebay.in\",\"cat\":\"online shopping all \",\"expdate\":\"2013-06-30\",\"dec\":\"Credit Card\\t 6% Off!\\tUse Coupon Code:\\r\\nCHDFCEBAY1\"}}]}\n<\/code><\/pre>\n<ol>\n<li>\n<p><code>$.each(json.posts,function(i,dat){<\/code> this should be <code>$.each(data.posts,function(i,dat){<\/code><\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-15 09:10:43. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>jquery mobile list view to load json data is not working please help me i am created php code to ganerate json file, i am trying load that json data to my jquery mobile list view but it is not loading crome console error is: &#8220;Uncaught ReferenceError: json is not defined &#8220; please solve this [&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-1411","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1411","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=1411"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}