并且在JAVASCRIPT中使用IF条件
如何在javascript中编写和处理if条件?我想要这个代码,但它产生了一个错误并且在JAVASCRIPT中使用IF条件,javascript,if-statement,conditional-statements,Javascript,If Statement,Conditional Statements,如何在javascript中编写和处理if条件?我想要这个代码,但它产生了一个错误 if(xmlDoc.selectSingleNode("//RentersInsuranceSetting/Row").getAttribute("ExcludeCorporateUnits")==1) AND (xmlDoc.selectSingleNode("//AllPeople/Row").getAttribute("BusinessCorporationBit")==1) { con
if(xmlDoc.selectSingleNode("//RentersInsuranceSetting/Row").getAttribute("ExcludeCorporateUnits")==1) AND (xmlDoc.selectSingleNode("//AllPeople/Row").getAttribute("BusinessCorporationBit")==1)
{
confirmValidRentersInsurance.required = "noReq"
confirmValidRentersInsurance.style.color = "blue"
insuranceRequired = false
}
javascript中的AND运算符是什么?javascript中的逻辑“AND”运算符是&&
还有一个JavaScript中的逻辑“and”操作符是&&
还有一个
看
也许可以在上面的网站上查看这些javascript教程
看
也许可以在上面的网站上查看这些javascript教程。操作员将完成此操作。例如
if (condition1 && condition2)
{ // if 2 conditions are true, then execute this line... }
&&
操作员将执行此操作。例如
if (condition1 && condition2)
{ // if 2 conditions are true, then execute this line... }
您可以使用
&
操作符
您还需要另一组括号,以便获得if(…)&&&(…)
,而不是if(…)&&(…)
:
如果(…&&&…),则删除一些括号使其成为。由于==
运算符的优先级高于&&
运算符,因此不需要它们:
if (xmlDoc.selectSingleNode("//RentersInsuranceSetting/Row").getAttribute("ExcludeCorporateUnits")==1 && xmlDoc.selectSingleNode("//AllPeople/Row").getAttribute("BusinessCorporationBit")==1)
您可以使用&
操作符
您还需要另一组括号,以便获得if(…)&&&(…)
,而不是if(…)&&(…)
:
如果(…&&&…)
,则删除一些括号使其成为。由于==
运算符的优先级高于&&
运算符,因此不需要它们:
if (xmlDoc.selectSingleNode("//RentersInsuranceSetting/Row").getAttribute("ExcludeCorporateUnits")==1 && xmlDoc.selectSingleNode("//AllPeople/Row").getAttribute("BusinessCorporationBit")==1)
javascript中的运算符是&&你们有并没有试过用谷歌搜索它?我用谷歌搜索了&&它产生了一个错误,所以我认为它是错误的。原来问题出在我的括号里。谢谢javascript中的运算符是&&你们有并没有试过用谷歌搜索它?我用谷歌搜索了&&它产生了一个错误,所以我认为它是错误的。原来问题出在我的括号里。谢谢我在google上搜索了一下&它产生了一个错误,所以我认为这是错误的。原来问题出在我的括号里。谢谢我在google上搜索了一下&它产生了一个错误,所以我认为这是错误的。原来问题出在我的括号里。谢谢