jQuery: hiding table row in IE 8 closes the browser?
So, I am looking at the piece of code:
var row = $(deletebutton).parent().parent();
var indexLabel = $(row).find("#" + indexLableId);
var rowIndex = $(indexLabel).val();
$(row).remove();
If I change last line to
$(row).hide();
the IE8 closes. What gives?
Update: This is very interesting now. If I click on the first row only IE crashes, on any other ro开发者_JAVA百科w it switches to compatibility view. It happens even if I do this
row[0].style.display = "none";
so it is not jQuery problem at all. Code is not mine nor the screen so I'll have to take a look what is going on.
Update 2: Ok, I think I know what is going on. Whoever coded this crap used same ids for children element in each row.
where is deletebutton set, what's in it?
i don' think you need the $() around row b/c .parent will return a jQuery object already.
try just row.hide();
精彩评论