![]() ![]() Clicking the line jumps the text in the content browser to the line with the breakpoint. For further information about the Scope Chain details sidebar, continue to Scope Chain.Įvery breakpoint you set across all your scripts appears under Breakpoints in the navigation sidebar, as shown in Figure 4-2. The Scope Chain contains a snapshot of variables available to the scope of the paused line, as well as their current values. ![]() As soon as Safari’s JavaScript interpreter reaches a line of code that has a breakpoint on it, JavaScript execution halts, and the Scope Chain details sidebar appears. Breakpoints retain their position across page loads, so your breakpoints won’t be lost. The line that you break on must contain code, otherwise script execution won’t pause at that line.Īfter one or more breakpoints are set, reload your page. Important: Setting a breakpoint on a blank line does nothing. Figure 4-1 An active breakpoint on line 17 and an inactive breakpoint on line 19 When a breakpoint is set, you can click it again to deactivate it, as shown in Figure 4-1. A blue marker is set, indicating that script execution will pause here the next time this line runs. To add a breakpoint, select a JavaScript resource in the Resources navigation sidebar, and click a line number in the gutter of the content browser. You may already be familiar with breakpoints if you have experience with compiled programming languages. Breakpointsīreakpoints are markers you set on JavaScript resources to indicate a pause in script execution. By setting breakpoints throughout your code, you can inspect the values of your variables and observe the call stack during runtime.Įven if your JavaScript is minified, Web Inspector pretty-prints-or expands-all of your scripts, allowing you to set breakpoints on minified content. If you are getting JavaScript errors on your webpage, you can use the Debugger navigation sidebar to assist you in finding the cause of the problem. For new documentation on Safari Web Inspector, please visit Safari Developer Help. Links to downloads and other resources may no longer be valid. This document no longer represents the most current version of Safari developer tools. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |