LevelUp! Studio » ie6 https://blog.levelup.in.th Experience the new world. Fri, 26 May 2017 10:06:07 +0000 th hourly 1 http://wordpress.org/?v=3.8.1 Bug IE6 javascript location และการแก้ไข https://blog.levelup.in.th/2010/01/28/bug-ie6-javascript-locationbug-ie6-javascript-location-%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82/ https://blog.levelup.in.th/2010/01/28/bug-ie6-javascript-locationbug-ie6-javascript-location-%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82/#comments Thu, 28 Jan 2010 14:03:13 +0000 http://blog.levelup.in.th/?p=354 เป็นบั๊กที่เกิดเฉพาะกับ 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){}

]]>
https://blog.levelup.in.th/2010/01/28/bug-ie6-javascript-locationbug-ie6-javascript-location-%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%81%e0%b9%89%e0%b9%84%e0%b8%82/feed/ 0