将字符串转化为布尔值的方法
<script>
function toboolean(val){
switch (val.toLowerCase()){
case "true": case 1: case "yes": return true;
case "false": case 0: case "no": case null: return false;
default:return Boolean(val);
}
}
alert(toboolean("TRUE"))
</script>