Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11 Can't Tell that Two Strings are Equal

For whatever reason, a condition is returning false when by all my accounts, it should be true. It's just a simple string comparison; and Chrome gets it right.

In the IE developer tools, I put a breakpoint on the line, and tried different things. Here's the output: enter image description here

The code this is getting called from is a jQueryUI widget. Here's the full block that the code is running in. I can post the entire widget if that's helpful.

this.element.children('option').each(function() {
    if ($(this).text() === select.val()) {  // Why does this evaluate to false?!?!?
        $(this).text(value)
        ctl._trigger('select', event, {
            item: this
        });
        return false;
    }
});
like image 651
M Falanga Avatar asked Oct 20 '22 00:10

M Falanga


1 Answers

Does $(this).text.match(/[\w ]+/)[0] and select.val().match(/[\w ]+/)[0] return the same thing?

I believe some of you space-like characters aren't spaces.

like image 55
plalx Avatar answered Oct 27 '22 17:10

plalx