Bug IE6 javascript location และการแก้ไข by plug.in
28
Jan0
Jan0
เป็นบั๊กที่เกิดเฉพาะกับ browser เจ้าปัญหาเช่นเคย คราวนี้เป็น bug เกี่ยวกับการเปลี่ยนหน้าด้วย javascript
ซึ่งปกติเราจะทำกันอย่างนี้
document.location.href = “http://www.levelup.in.th/”;
แต่ปรากฎว่ามันใช้ไม่ได้ใน IE6! หลังจากหาข้อมูลมาได้ สรุปแล้วเราต้องเพิ่ม
window.event.returnValue = false;
เข้าไปใน code ด้วย แต่คราวนี้ดันทำให้ browser
try {
document.location.href = site_url(u);
window.event.returnValue = false;
}catch(e){}
Enjoy this article?
Consider subscribing to our RSS feed!
ไม่มีความเห็น
ยังไม่มีความเห็น