下面这段javascript代码这样写对吗
<script>
if not (window.confirm( "continue? "))
{
alert( "operation 1 ");
}
else
{
alert( "operation 2 ");
}
</script>
如果不对那该把 not放在哪
------解决方案--------------------if ( ! confirm( "continue? "))
另外干嘛要not?
opration1 operation2 换个位置不行?
------解决方案--------------------<script>
if (!!!window.confirm( "continue? "))
{
alert( "operation 1 ");
}
else
{
alert( "operation 2 ");
}
</script>
------解决方案--------------------<script>
if(!window.confirm( "continue? "))
{
alert( "operation 1 ");
}
else
{
alert( "operation 2 ");
}
</script>
没有not,C#里!号就是非的意思,所以可以这样写。
------解决方案--------------------JScript code
<script>
alert(window.confirm("continue?")?"operation 1 ":"operation 2 ";
</script>
------解决方案--------------------
<script type=...>
if not (window.confirm( "continue? "))
firebug 调调