Front-end digital comparison must take it converts into digital type!

 function checkOriginPriceAndPromotePrice(origin, promote){
    	var p1 = parseInt(origin);
    	var p2 = parseInt(promote);

    	if(p2>p1){
    		alert("优惠价格不能大于原价!");
    		return false;
    	}
    	return true;
    }

If not, then into digital type, occurs when the effect of anti-human comparison, such obviously var num1 = 2, var num2 = 1, but if (num1> num2) is determined up to false will appear Shique is avoided skull pain, preferably steady hand converts it into a digital type! !

Published 63 original articles · won praise 1 · views 2659

Guess you like

Origin blog.csdn.net/qq_42039738/article/details/104629465