Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It means that the property is not defined at that point. So check if you have defined the property.</p> <p>The question obviously needs the source-code to be answered. Please put them.</p> <p><strong>EDIT</strong></p> <p>Its an out of bound problem. Change this line:</p> <pre><code>generatedProductDisplay = '&lt;div id="'+productJSON[a].id+'" class="productDiv"&gt;&lt;a class="productLink" href="#"&gt;&lt;center&gt;&lt;div class="productImage"&gt;&lt;img src="'+productJSON[a].image+'" width="100%" height="200px" alt="'+productJSON[a].name+'"&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="productName"&gt;'+productJSON[a].name+'&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/a&gt;&lt;/div&gt;'; </code></pre> <p><code>a</code> contains value out of the range of the array. Change it to <code>i</code>.</p> <p>As you have not stated your logic. I assume that the inner loop does nothing (from what i can derive) and suggest this:</p> <pre><code>for(var i=0;i&lt;productJSON.length;i++){ var pagedisplay = ''; var generatedProductDisplay = ''; generatedProductDisplay = '&lt;div id="'+productJSON[i].id+'" class="productDiv"&gt;&lt;a class="productLink" href="#"&gt;&lt;center&gt;&lt;div class="productImage"&gt;&lt;img src="'+productJSON[i].image+'" width="100%" height="200px" alt="'+productJSON[i].name+'"&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="productName"&gt;'+productJSON[i].name+'&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/a&gt;&lt;/div&gt;'; pagedisplay = pagedisplay+generatedProductDisplay; pagedisplay = pagedisplay+'&lt;br/&gt;'; $(".productDisplay").append(pagedisplay); } </code></pre> <p><strong>EDIT 2</strong></p> <p>As i still didnt understand your inner loop, here is my take on it:</p> <p>Without inner loop:</p> <pre><code>http://jsfiddle.net/guSLL/ $(document).ready(function() { var productJSON = [ { id: "1001", name: "Hopper1", image: "images/290161k.jpg"}, { id: "1002", name: "Hopper2", image: "images/290161k.jpg"}, { id: "1003", name: "Hopper3", image: "images/290161k.jpg"}, { id: "1004", name: "Hopper4", image: "images/290161k.jpg"}, { id: "1005", name: "Hopper5", image: "images/290161k.jpg"}, { id: "1006", name: "Hopper6", image: "images/290161k.jpg"}, { id: "1007", name: "Hopper7", image: "images/290161k.jpg"}, { id: "1008", name: "Hopper8", image: "images/290161k.jpg"} ]; for (var i = 0; i &lt; productJSON.length; i++) { var pagedisplay = ''; generatedProductDisplay = '&lt;div id="' + productJSON[i].id + '" class="productDiv"&gt;&lt;a class="productLink" href="#"&gt;&lt;center&gt;&lt;div class="productImage"&gt;&lt;img src="' + productJSON[i].image + '" width="100%" height="200px" alt="' + productJSON[i].name + '"&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="productName"&gt;' + productJSON[i].name + '&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/a&gt;&lt;/div&gt;'; pagedisplay = pagedisplay + generatedProductDisplay; pagedisplay = pagedisplay + '&lt;br/&gt;'; $(".productDisplay").append(pagedisplay); } $(".productDiv").live("click", function() { alert("Hello"); }); }); </code></pre> <p>With inner loop:</p> <p><a href="http://jsfiddle.net/guSLL/1/" rel="nofollow">http://jsfiddle.net/guSLL/1/</a></p> <pre><code>$(document).ready(function() { var productJSON = [ { id: "1001", name: "Hopper1", image: "images/290161k.jpg"}, { id: "1002", name: "Hopper2", image: "images/290161k.jpg"}, { id: "1003", name: "Hopper3", image: "images/290161k.jpg"}, { id: "1004", name: "Hopper4", image: "images/290161k.jpg"}, { id: "1005", name: "Hopper5", image: "images/290161k.jpg"}, { id: "1006", name: "Hopper6", image: "images/290161k.jpg"}, { id: "1007", name: "Hopper7", image: "images/290161k.jpg"}, { id: "1008", name: "Hopper8", image: "images/290161k.jpg"} ]; for (var i = 0; i &lt; productJSON.length;) { var pagedisplay = ''; for (j = 0; j &lt; 2 &amp;&amp; i &lt; productJSON.length; j++, i++) { generatedProductDisplay = '&lt;div id="' + productJSON[i].id + '" class="productDiv"&gt;&lt;a class="productLink" href="#"&gt;&lt;center&gt;&lt;div class="productImage"&gt;&lt;img src="' + productJSON[i].image + '" width="100%" height="200px" alt="' + productJSON[i].name + '"&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="productName"&gt;' + productJSON[i].name + '&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;/a&gt;&lt;/div&gt;'; pagedisplay = pagedisplay + generatedProductDisplay; pagedisplay = pagedisplay + '&lt;br/&gt;'; } $(".productDisplay").append(pagedisplay); } $(".productDiv").live("click", function() { alert("Hello"); }); }); </code></pre>
    singulars
    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