I have the following code:
var currentServerlist = []; var newServerIp = document.getElementById('add_server').value; if( CurrentServerIP != newServerIp ) { $('#failoverServers td.row_selector').each(function() { var row = $(this).closest('tr'); var serverIp = row.find('td[rel=ip]').text(); currentServerlist.push(serverIp); }); if(currentServerlist.lastIndexOf(newServerIp) != -1) { return true; } return false; }
But I found that lastIndexOf does not work in InternetExplorer (it works in Chrome).
How can i fix this?
javascript
user1646528
source share