Quên mật khẩu?

Ẩn quảng cáo

 

 [JS] Tránh mất nội dung khi post bài

Go down 
Tác giảThông điệp
admin
[—»Sói™~]-[Ðại Ma Ðầu]
[—»Sói™~]-[Ðại Ma Ðầu]
admin


Giới tính Giới tính : Nam Virgo
Chinese zodiac Chinese zodiac : Horse
Bài viết Bài viết : 1042
Xu Xu : 158
Thanked Thanked : 650
Sinh Nhật Sinh Nhật : 20/09/1990
Tham Gia Tham Gia : 15/07/2011
Tuổi Tuổi : 34
Yahoo Yahoo : Hà Nội
Nghề Nghiệp Nghề Nghiệp : Giáo Sư
Status Status : hgfggggggggggggg

Character sheet
Tài Sản:

[JS] Tránh mất nội dung khi post bài Empty
Bài gửiTiêu đề: [JS] Tránh mất nội dung khi post bài   [JS] Tránh mất nội dung khi post bài EmptySun Aug 07, 2011 4:33 pm

Vào Templates > Post & Tin nhắn > Posting Body.
Chèn đoạn này vào đầu
Code:
<script language=Javascript type=text/javascript>
// Cross browser event handling for IE 5+, NS6+ and Gecko
function addEvent(elm, evType, fn, useCapture)
{
if (elm.addEventListener)
{
// Gecko
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent)
{
// Internet Explorer
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else
{
// nutscrape?
elm['on' + evType] = fn;
}
}

// Add Listeners
function addListeners(e)
{
// Before unload listener
addEvent(window, 'beforeunload', exitAlert, false);
}

// Exit Alert
function exitAlert(e)
{
var msg = "You will lose information if it has not already been saved.";

// set event
if (!e) { e = window.event; }
if (e) { e.returnValue = msg; }

// return warning message
return msg;
}

// Initialise
addEvent(window, 'load', addListeners, false);
</script>
Khi post bài - đóng cửa sổ. Thông báo sau sẽ hiện ra
[You must be registered and logged in to see this link.]
Có thể sửa dòng var msg = "You will lose information if it has not already been saved."; thành tiếng Việt
Về Đầu Trang Go down
https://itvui.123.st
 
[JS] Tránh mất nội dung khi post bài
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» [Truyện tranh]
» [HOT] Tranh 3D đường phố đẹp như thật.......
» [Truyện tranh]
» Truyện tranh hài về...cưa boom
» [Truyện tranh]Những câu nói mất ngủ =))

Permissions in this forum:Bạn không có quyền trả lời bài viết
Kênh thông tin giải trí dành cho teen việt :: *`+`* Mã Nguồn *`+`* :: Thủ Thuật Forumotion :: Code-
Chuyển đến