The object does not support this property or method only in IE8

This code runs in Chrome, FF, Safari, IE9, but in IE8 I get this error:

Message: The object does not support this property or method. Line: 80 Char: 7 Code: 0

and this is what code it stops at: (line 80 is on "return [", but the debugger of the developer tool selects all this code below)

return [ { title:'Edit', customClass:'actionEdit', action:{ type:'getLink', url:'/admin/products/edit/'+data.id()+'' } }, { title:'Attaches', customClass:'actionAttaches', action:{ type:'getLink', url:'/admin/attaches/index/product/'+data.id()+'' } }, { title:'Delete', customClass:'actionDelete', action:{ type:'postLink', url:'/admin/products/delete/'+data.id()+'', confirm:'Are you sure you want to delete %s?', arg:$('#ProductAdminIndexList #'+data.id()+' .productId').text().trim() } } ]; 

I found other similar cases, but I do not know why this is happening and how to solve this problem.

+4
source share
2 answers

Decide how it is.

 arg: $.trim($('#ProductAdminIndexList #'+data.id()+' .productId').text()) 
+8
source

I am pretty sure IE8 does not have a trim() method. jQuery however provides an implementation , name it as $.trim() , since it looks like you are already using jQuery.

+2
source

Source: https://habr.com/ru/post/1435157/


All Articles