>>วิธีทำให้น้องหมาแสดงขนาดไฟล์ก่อนโหลด<<
ใน IE จะสามารถแสดงขนาดไฟล์ก่อนโหลดได้ แล้วมีรึที่น้องหมาของเราจะน้อยหน้า มันต้องใช้
เทคนิคกานหน่อย?
ลุยกานเรย
???? คลิกขวาที่ Shortcut ของ Firefox แร้วเลือก Properties เลือก Find Target...
?แล้วมองหาโฟลเดอร์ที่ชื่อ "components"
เปิดโฟลเดอร์เข้าไปแล้วมองหาไฟล์ที่ชื่อ "nsHelperAppDlg.js" คลิกขวาที่ไฟล์ เลือก
Open With... แล้วเลือกเปิดด้วย Text Editor ตัวไหนก็ได้ ผมใช้ Notepad ละกันง่ายสุด
?เปิดแล้วก็มองหาCode
fname = suggestedFileName; (ปกติจะอยู่บรรทัดที่365)
แล้วก็ก๊อปโค๊ตด้านล่างนี้ไปใส่ท้ายบรรทัดที่หาได้เรย
// =====================================
// Begin Download File Size by the DtTvB
//
try {
//
// Create an XMLHttpRequest, to get the HEAD response...
//
var xh = new this.mDialog.XMLHttpRequest();
xh.open ("HEAD", url.spec, false);
xh.send (null);
//
// Get the response header.
//
var clen = xh.getResponseHeader('Content-Length');
if (clen) {
//
// Add to the filename for show.
//
clens = clen + ' bytes';
if (clen > 1024)
clens = (Math.round(clen / 102.4) / 10) + ' KB';
if (clen > 1000000)
clens = (Math.round(clen / 104857.6) / 10) + ' MB';
fname += ' (' + clens + ')';
}
} catch (e) {
//
// Error handler! :P
//
}
//
// Code finished! ;) the DtTvB
// =====================================
สงสัยว่าแปงไง ดูจากรูปได้เรยจ้า
เสร็จแล้วก็เซฟ รีน้องหมาซะ1ที จากนั้นท่านก็จะเห็นความเปลี่ยนแปลง ตอนโหลด
ขอบคุณ : DtTvB and FirefoxThai