二維數組會話我有一個二維數組會話和我試圖清除它在打印賬單後。要這樣做我使用此代碼清除使用JSP
<script type="text/javascript">
function textsizer(e) {
var evtobj=window.event? event : e;
var element = evtobj.target ? evtobj.target : evtobj.srcElement;
if (element.tagName.toLowerCase() == "body") {
var unicode=evtobj.charCode? evtobj.charCode : evtobj.keyCode;
var actualkey=String.fromCharCode(unicode)
if(actualkey=="x"){
show_confirm()
function show_confirm(){
var con = confirm("Are You Sure you wan to cancel this bill?");
if (con ==true){
session.invalidate();
}
else{
alert("You pressed Cancel!");
}
}
}
}
}
document.onkeypress=textsizer
</script>
但此代碼不清除會話。我試過它使用谷歌瀏覽器和Internet Explorer,但沒有奏效。任何人都可以幫助我做這件事嗎? 我也試圖用php來做,但它也不適合我。我的情況,我想通過鍵盤按x刪除會話也不管是什麼語言,我只是要清除的會話按X鍵
jsp? Java服務器頁面? – 2012-07-13 17:54:46