Link to home
Start Free TrialLog in
Avatar of Wanting2LearnMan
Wanting2LearnManFlag for United Kingdom of Great Britain and Northern Ireland

asked on

lastIndexOf does not work in Internet Explorer

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;

Open in new window


But I find that the lastIndexOf does not work in InternetExplorer (It does in Chrome).

How can I fix this?
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial