Templates bugzilla模板为什么我的字符串==对于两个不同的字符串返回true

Templates bugzilla模板为什么我的字符串==对于两个不同的字符串返回true,templates,bugzilla,Templates,Bugzilla,我的if(str==seltext)始终返回true 这是我的密码:- [% FOREACH cll = classifications %] var str = "[% cll.object.name FILTER js %]"; var seltext = classSel.options[classInd].text; alert(str+" "+seltext); if(str == seltext) { alert("classf

我的if(str==seltext)始终返回true

这是我的密码:-

[% FOREACH cll = classifications %]
    var str = "[% cll.object.name FILTER js %]";
    var seltext = classSel.options[classInd].text;
    alert(str+" "+seltext);
    if(str == seltext)
    {
        alert("classfound=[% cll %]");     /// THIS ALWAYS GETS FIRED
    }
[% END %]

我无法理解为什么会发生这种情况,我想可能是因为[%1]只保存了变量str一次,但它们不会更改我的警报。

我解决这一问题的方法是尊重if语句,所以它是这样的

if(classSel.options[classInd].text == "[% cll.object.name FILTER js %]")
那就行了