I am trying to create an automatic offer item manually. I am using canjs for this prupose.
The following code I have tried so far:
list.filter( function( item, index, list ) { if(item.includes(searchText) && searchText != ''){ //css hide and show classes for match } else{ // css show for unmatched results } })
In the above code, I ran into two problems:
include does not work in all browsers. To do this, I tried the match,
contains a substring, but they could not help me.
includes work in chrome, but when I entered the line, the substring is not contained in the last element of the list, this will not be because the filter will continue to search from all elements.
Is there any mistake I am making?
I want it to run in all browsers.
Thanks.
source share