Đang chuẩn bị liên kết để tải về tài liệu:
Tương tác giữa PHP và jQuery - part 29

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

CHAPTER 8 ■ EDITING THE CALENDAR WITH AJAX AND JQUERY "deserialize" : function(str){.}, "urldecode" : function(str) {.} }; Fixing Timezone Inconsistencies You aren’t passing a time or timezone to the Date object, so that object will default to midnight Greenwich Mean Time (00:00:00 GMT). This can cause your dates to behave unexpectedly for users in different timezones. To address this problem, you’ll need to adjust the date by the timezone offset using two built-in Date object methods: .setMinutes() and .getTimezoneOffset(). The return value of .getTimezoneOffset() is the difference in the number of minutes between GMT and the user’s timezone. For instance, the return. | CHAPTER 8 EDITING THE CALENDAR WITH AJAX AND JQUERY deserialize function str . urldecode function str . Fixing Timezone Inconsistencies You aren t passing a time or timezone to the Date object so that object will default to midnight Greenwich Mean Time 00 00 00 GMT . This can cause your dates to behave unexpectedly for users in different timezones. To address this problem you ll need to adjust the date by the timezone offset using two built-in Date object methods .setMinutes and .getTimezoneOffset . The return value of .getTimezoneOffset is the difference in the number of minutes between GMT and the user s timezone. For instance the return value of .getTimezoneOffset in Mountain Standard Time -0700 is 420. Using .setMinutes you can add the value of the timezone offset to the Date object which will return the date to midnight on the given day no matter what timezone the user is in. You can make that adjustment using the following bold code fx initModal function . boxin function data modal . boxout function event . Adds a new event to the markup after saving addevent function data formData Converts the query string to an object var entry fx.deserialize formData Makes a date object for current month cal new Date NaN Makes a date object for the new event event new Date NaN Extracts the event day month and year date entry.event_start.split 0 Splits the event data into pieces edata date.split - Extracts the calendar month from the H2 ID cdata h2 .attr id .split - Sets the date for the calendar date object cal.setFullYear cdata 1 cdata 2 1 Sets the date for the event date object event.setFullYear edata 0 edata 1 edata 2 Since the date object is created using 281 CHAPTER 8 EDITING THE CALENDAR WITH AJAX AND JQUERY GMT then adjusted for the local timezone adjust the offset to ensure a proper date event.setNinutes event.getTimezoneOffset deserialize function str . urldecode function str . Ensuring the Event Occurs in the Current Month Your next step is to set up a .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.