我正在看这个代码,因为我是网页设计的新手,我无法理解它.
因此,在我的索引页面上,我有一个链接到谷歌和ext.js页面以下代码.
这就是我所理解的错误.
用户单击ok或cancel,因此变量c是ok或cancel.现在我没有看到if声明的重点,因为它将是ok或者cancel在其他方面是真还是假.
$(window).unload(function(){
var c = confirm('Are you sure you want to leave?');
if(c){
return true;
}else{
return false;
}
});
Run Code Online (Sandbox Code Playgroud) jquery ×1