tailieunhanh - Professionali Phone and iPod touch Programming phần 10

Các tính năng gỡ lỗi tốt nhất hiện có trong Safari chắc chắn là Thanh tra Web. Thanh tra Web, thể hiện trong hình 12-2, cho phép bạn duyệt và kiểm tra DOM của trang web hiện hành. Bạn có thể truy cập tính năng này thông qua trình đơn Debug. Tuy nhiên, cách handiest để sử dụng nó là kích chuột phải vào một | Chapter 12 Testing and Debugging Table 12-1 Useful Safari Debug Commands for the iPhone Developer Name Description User Agent Spoof another browser though current version does not include a Mobile Safari user agent string . Show Web Inspector View and search the DOM currently Mac OS X only . Show Snippet Editor Get instant rendering of an HTML snippet. Log JavaScript Exceptions Turn on to log exceptions. Show JavaScript Console View JavaScript errors occurring on a page. Enable Runaway JavaScript Timer Toggle the timer that halts long-running scripts. The two Safari debug features worth special attention are the Web Inspector and JavaScript Console. Working with the Safari Web Inspector The best debugging feature available in Safari is certainly the Web Inspector. The Web Inspector shown in Figure 12-2 enables you to browse and inspect the DOM of the current Web page. You can access this feature through the Debug menu. However the handiest way to use it is to right-click an element in your document and choose the Inspect Element menu item. The Web Inspector is displayed showing the element in the context that you selected in the browser window. At the time of this writing the Web Inspector is only available on Mac OS X. However expectations are that a cross-platform version of this developer tool will be available in the future. Here are the basic functions of the Web Inspector Selecting a node to view When you click on a node in the inspector pane two things happen. First the bottom pane displays node and attribute details style hierarchy style metrics and property values. Second if the selected node is a visible element in the browser window the selected block is highlighted with a red border in Safari. Changing the root To avoid messing with a massive nested DOM hierarchy you can change the context of the Web Inspector. Double-clicking a node makes it the hierarchical root in the inspector pane. Later if you want to move back up the document hierarchy use the up

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.