Detect when your site is visible to users
tipjs,web_developer
document.onvisibilitychange = function () {
document.visibilityState === "visible"
? (document.title = "👋 Hello")
: (document.title = "😟 Bye!");
};
Có thể bạn đã miss một số snippets code
Rolling loading
Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .
try/catch es10
An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.
Getting the last element of a split string array
Getting the last element of a split string array
serialize Form
Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.
Kiểm tra định dạng email bằng Javascript
Kiểm tra định dạng email bằng Javascript