TAILIEUCHUNG - Beginning Ajax with PHP ( PHP AND AJAX Tool Tips One of the more) - P.3

Tham khảo sách 'beginning ajax with php ( php and ajax tool tips one of the more) - ', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 9 27 06 2 49 PM Page 44 44 CHAPTER 3 PHP AND AJAX Tool Tips One of the more common DHTML tricks you will see on the Internet is the tool tip. This is basically a little box filled with information that will appear above a properly placed cursor. While this is all fine and dandy the information contained within said box in non-Ajax enabled web sites is usually either hard-coded in or potentially loaded through some serverside trickery. What you will do in the next example is load the box dynamically using Ajax. As a useful addition to your calendar application it would be nice to dynamically display a box with all currently assigned tasks when a user hovers over a certain date. The PHP script would henceforth have to scour the database and return any instances of tasks associated with said day. Since I m not going to get into databases just yet I ll have you build the script to accommodate an array of tasks for now just to showcase the tool tip functionality. First off let s have a look at the file in order to view the changes to the calendar code Let s make an appropriate number of rows. for k 1 k numrows k tr php Use 7 columns for 7 days . for i 0 i 7 i startdate if startdate 0 startdate lastday If we have a blank day in the calendar. td style background FFFFFF nbsp td php else if startdate date j month date n year date Y td onclick createform event class calendartodayoff onmouseover calendartodayover checkfortasks php echo year . - . month . - . startdate event onmouseout calendartodayoff hidetask php echo date j td php else td onclick createform event class calendaroff onmouseover calendarover checkfortasks php echo year . - . month . - . startdate event onmouseout calendaroff hidetask php echo startdate td php tr php 9 27 06 2 49 PM Page 45 CHAPTER 3 PHP AND AJAX 45 The major change made here is calling a checkfortasks function that is fired by the onmouseover .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.