โค้ด Javascript สำหรับปิดแท็บหรือหน้าต่างของ Firefox (รวมทั้งเบราว์เซอร์ตัวอื่นๆ)
อาจจะมีบางท่าน กำลังหาโค้ด สำหรับปิดหน้าต่างเบราวเซอร์ หรือปิดแท็บของเบราว์เซอร์ต่างๆ แต่ก็หาไม่ได้ซักที เพราะที่แจกกันก่อนหน้านี้ (เก่า) มักจะใช้ไม่ได้แต่มาวันนี้ เราจัดเตรียมให้ท่านแล้ว (โค้ดอิงมากจาก KTBonline ของกรุงไทย)<script language="javascript" >
function closeWindows() {
//callSingleParseXmlWithCallBack('Login.do?cmd=logout');
//uncomment to open a new window and close this parent window without warning
var nAgt = navigator.userAgent;
if ((verOffset=nAgt.indexOf("MSIE"))!=-1){
//Close for IE
window.open('','_parent','');
window.close();
}
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1){
window.opener=self;
window.close();
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
}catch(e){
//alert(e);
}
window.open('','_parent','');
window.close();
}else {
openWin=window.open('','_self');
openWin.close();
}
}
</script>
การใช้งาน<a href="javascript:closeWindows();"><img src="/new/resources/themeOne/images/th/images/Button/close.gif" width="86" height="22" /></a>
เอวัง
jaideejung007's เจิมด้วย เก็บก่อน ไม่รู้จะทำอะไร {:21_820:} ขอบพระคุณอย่างยิ่งถ้ามีโอกาศผม จะบวชให้พี่ ครับ sm913dz
หน้า:
[1]