JavaScript Bible, Gold Edition part 193

JavaScript Bible, Gold Edition part 193. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-412 Part VI Appendixes assigned to its nested text node after the page loads in the i nit function . That fixed range becomes a solid reference point for you to use while you select text in the paragraph. Note Unfortunately the window object method that converts a user selection into an object is not connected correctly in the first release of NN6. Even if it were the inverted values returned by the compareBoundaryPoints method would give you incorrect results. Try this example on subsequent versions of NN6. After you make a selection all four versions of the compareBoundaryPoints method run to compare the start and end points of the fixed range against your selection. One column of the results table shows the raw value returned by the compareBoundaryPoints method while the third column puts the results into plain language. To see how this page works begin by selecting the first word of the fixed text range carefully drag the selection from the first red character . You can see that the starting positions of both ranges are the same because the returned value is 0. Because all of the invocations of the compareBoundaryPoints method are on the fixed text range all comparisons are from the point of view of that range. Thus the first row of the table for the START_TO_END parameter indicates that the start point of the fixed range comes before the end point of the selection yielding a return value of -1. Other selections to make include Text that starts before the fixed range and ends inside the range Text that starts inside the fixed range and ends beyond the range Text that starts and ends precisely at the fixed range boundaries Text that starts and ends before the fixed range Text that starts after the fixed range Study the returned values and the plain language results and see how they align with the selection you made. Listing 19-4 Lab for NN6 compareBoundaryPoints Method HTML HEAD TITLE Method TITLE STYLE TYPE text css TD .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.