简体   繁体   中英

How can I do a string comparison in a while loop in JavaScript

I am populating an HTML control using a JavaScript while loop. I need to exclude a string value from the population. I am trying this code but it is not working. What am I doing wrong here?

function getWebPropertiesSucceeded()
{
    var user = groupOwnerUsers.getEnumerator();

    while (user.moveNext())
    {
        if (user.get_current().get_title() != 'gps\ims sharepoint site collectors')
        {
            AddRowToTable(user.get_current().get_title());
        }
    } 
}

the gps\\ims sharepoint site collectors value is still being added to my control. How can I fix this problem?

\\开始一个转义序列,替换为\\\\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM