Wednesday, 18 September 2013

JavaScript stack size exceeded when using thick-box for multiple divisions approximately 6K

JavaScript stack size exceeded when using thick-box for multiple divisions
approximately 6K

I have a table displayed on the page with item details displayed . When
total cells are less than 5K then there is no JavaScript error but when
table has 6K rows or more then stack exceeding error occurs and JavaScript
doesn't works.
$(document).ready(function() {
$('body').click(function(e){
var Elem = e.target;
var itemgroup = $(Elem).attr('rel');
var itemid = $(Elem).attr('itemno');
if (Elem.className == 'additem'){
tb_show('Add' ,
'add_item.html'+'?&itemid='+itemid+'&itemgrp='+itemgroup+'&TB_iframe=true&height=420width=500',
'/images/items.jpg');
}
else if (Elem.className == 'showsoldqty'){
tb_show('Show' ,
'show_sold_qty.html'+'?&itemid='+itemid+'&itemgrp='+itemgroup+'&TB_iframe=true&height=420width=500',
'/images/items.jpg');
}
});
The table structure is as mentioned below with one row as sample (the
column in this row is being repeated and displayed more than 6K times) :
<table>
<tr>
<td>
<div class="additem" rel="G1" itemno="21">Add Item</div>
<div class="showsoldqty" rel="G2" itemno="22">Show Sold
Quantity</div>
</td>
</tr>
</table>

No comments:

Post a Comment