Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

วิธีตรวจสอบว่า JavaScript Cookies ถูกปิดใช้งาน (Disabled)

ใช้ Object navigator.cookieEnabled ตรวจสอบว่า Cookies ถูก Enable หรือไม่

if (navigator.cookieEnabled) { 
  document.write("Cookies Enabled"); 
} else { 
  document.write("Oops Cookies Not Enabled"); 
}