Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to filter the multiple duplicate values using jquery?
    primarykey
    data
    text
    <p>I have a json like following type.</p> <pre><code>{ "19": { "entity_id": "19", "type_id": "simple", "sku": "Dell laptop", "description": "The Inspiron 15R laptop features a 15.6\" screen, color options and up to 3rd Gen Intel® Core™ processors to keep you stylish and connected.", "short_description": "The Inspiron 15R is a well-balanced laptop with something for everyone. Unless you need longer battery life, there's no need to spend more.", "meta_keyword": "The Inspiron 15R is a well-balanced laptop with something for everyone. Unless you need longer battery life, there's no need to spend more.", "name": "dell inspiron 15r", "meta_title": "Laptop | Dell | Inspiron15R", "meta_description": "The Inspiron 15R is a well-balanced laptop with something for everyone. Unless you need longer battery life, there's no need to spend more.", "regular_price_with_tax": 32500, "regular_price_without_tax": 32500, "category_name": "Laptop", "category_id": "19", "final_price_with_tax": 31000, "final_price_without_tax": 31000, "is_saleable": "1", "image_url": "http://192.168.18.171/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/h/o/how-to-deal-with-hp-laptop-power-issues.jpg" }, "20": { "entity_id": "20", "type_id": "simple", "sku": "Sony Laptop", "description": "Although Sony made computers in the 1980s exclusively for the local (Japan) market, the company withdrew from the computer business around the turn of the decade. Sony's re-entry to the global computer market under the new VAIO brand, began in 1996 with the PCV series of desktops", "short_description": "Originally an acronym of Video Audio Integrated Operation, this was amended to Visual Audio Intelligent Organizer in 2008 to celebrate the brand's 10th anniversary", "meta_keyword": "Originally an acronym of Video Audio Integrated Operation, this was amended to Visual Audio Intelligent Organizer in 2008 to celebrate the brand's 10th anniversary", "name": "Sony VAIO", "meta_title": "Laptop | Sony | VAIO", "meta_description": "Originally an acronym of Video Audio Integrated Operation, this was amended to Visual Audio Intelligent Organizer in 2008 to celebrate the brand's 10th anniversary", "regular_price_with_tax": 34299, "regular_price_without_tax": 34299, "category_name": "Laptop", "category_id": "19", "final_price_with_tax": 33000, "final_price_without_tax": 33000, "is_saleable": "1", "image_url": "http://192.168.18.171/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/s/o/sony-vaio-vpcea1bgn-bi-2.jpg" }, "21": { "entity_id": "21", "type_id": "simple", "sku": "HTC Mobiles", "description": "HTC is the creator of many award-winning mobile devices and industry firsts. HTC's portfolio includes smartphones and tablets powered by HTC Sense™", "short_description": "HTC is the creator of many award-winning mobile devices and industry firsts. HTC's portfolio includes smartphones and tablets powered by HTC Sense™", "meta_keyword": "HTC is the creator of many award-winning mobile devices and industry firsts. HTC's portfolio includes smartphones and tablets powered by HTC Sense™", "name": "HTC Desire X Dual Sim", "meta_title": "SmartPhones | HTC | DESIRE X", "meta_description": "HTC is the creator of many award-winning mobile devices and industry firsts. HTC's portfolio includes smartphones and tablets powered by HTC Sense™", "regular_price_with_tax": 13500, "regular_price_without_tax": 13500, "category_name": "Smartphones", "category_id": "20", "final_price_with_tax": 13500, "final_price_without_tax": 13500, "is_saleable": "1", "image_url": "http://192.168.18.171/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/h/t/htx-desire-x-ii.jpg" }, "22": { "entity_id": "22", "type_id": "simple", "sku": "Nokia Mobiles", "description": "Award-winning PureView technology, Carl Zeiss optics and six physical lenses. The Nokia Lumia 925 lets you capture the great moments, day or night.", "short_description": "Award-winning PureView technology, Carl Zeiss optics and six physical lenses. The Nokia Lumia 925 lets you capture the great moments, day or night.", "meta_keyword": "Award-winning PureView technology, Carl Zeiss optics and six physical lenses. The Nokia Lumia 925 lets you capture the great moments, day or night.", "name": "Nokia Lumia 925", "meta_title": "SmartPhones | Nokia | Lumia 925", "meta_description": "Award-winning PureView technology, Carl Zeiss optics and six physical lenses. The Nokia Lumia 925 lets you capture the great moments, day or night.", "regular_price_with_tax": 29930, "regular_price_without_tax": 29930, "category_name": "Smartphones", "category_id": "20", "final_price_with_tax": 29930, "final_price_without_tax": 29930, "is_saleable": "1", "image_url": "http://192.168.18.171/magento/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/n/o/nokia-lumia-925.jpg" } } </code></pre> <p>Now I want to filter the duplicate of categor id and categroy name values then i want to append the listview i am try to using following method only filter the category name only</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).on('pageshow', function () { $.mobile.loading('show'); $.getJSON("http://vinoth.com/magento/api/rest/products", function (data) { var uniqueCategory = []; $.each(data, function (i, row) { if ($.inArray(row.category_name, uniqueCategory) === -1) uniqueCategory.push(row.category_name) }); for (var i = 0; i &lt; uniqueCategory.length; i++) { $("#category").append('&lt;li&gt;&lt;a href="#"&gt;&lt;h2&gt;' + uniqueCategory[i] + '&lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;') } $("#category").listview('refresh'); $.mobile.loading('hide'); }); }); &lt;/script&gt; </code></pre> <p>how to filter the both category_id and category_name?.I want to append the both id and name</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload