我有一个变量 CampaignType,它的值为 0。但在警报中(双星内)它变为 1。为什么会这样?这是我的 javascript 代码片段
if (CampaignType != 2)
{
if (CampaignType = '1')
{
**alert(CampaignType);**
var CampaignAmount = (SelValue * CampaignPrice) / 100;
SelValue = SelValue - (CampaignAmount);
}
else if (CampaignType = '0')
{
SelValue = SelValue - CampaignPrice;
}
}