You’re using the minified version of jQuery. Instead, load the uncompressed version of jQuery into your page for testing.If you are loading the code from the Google Ajax Libraries API with a <script>tag,change it like this:
Now you will be able to step into and through the jQuery code.
Having fixed that problem, you want to learn how jQuery’s.html() and .show() methods work. So, you are trying to trace into this code in the debugger:
But when you use the Step Into command, the debugger goes into the jQuery constructor instead of either of the methods that you’re interested in.
The previous line of code contains three function calls: a call to the jQuery ($) constructor followed by calls to the .html() and .show() methods. The Step Into command steps into the first of those calls, the constructor.
At that point you can immediately do a Step Out followed by another Step In. This steps you out of the jQuery constructor (thus putting you back in the middle of the original line of code) and then into the .html() method.
To get to the .show() method, use another pair of Step Out and Step In commands.Each time you do this, you’ll work your way one step further through the jQuery chain.
If this gets tedious, break the chain as described in Recipe 5.15, and add debugger; statements wherever you want to stop. If you want to trace into the .show() method,you can change the code to the following:
Now when the code stops on the debugger; statement, you can just use Step In (twice,first to step to the $test.show(); statement and then to step into that function call).
The minified version of jQuery is great for production use but not so good for development.It collapses all of the code into one or two lines, making it nearly impossible to step through the code in a debugger. Also, the common use of chained methods makes it more difficult to step into jQuery methods. Using the tips in this recipe, you can easily trace through the jQuery code in the debugger, whether to chase down a bug or to learn how the code works.
J Query Related Interview Questions
|HTML 4 Interview Questions||HTML Interview Questions|
|HTML 5 Interview Questions||Zend Interview Questions|
|JqueryUI Interview Questions||Dynamic HTML Interview Questions|
|XQuery Interview Questions||jQuery Mobile Interview Questions|
J Query Related Practice Tests
|HTML 4 Practice Tests||HTML Practice Tests|
|HTML 5 Practice Tests||Zend Practice Tests|
|PHP and Jquery Practice Tests||J Query Practice Tests|
|CodeIgniter Practice Tests||Dynamic HTML Practice Tests|
J Query Tutorial
Selecting Elements With Jquery
Beyond The Basics
Faster, Simpler, More Fun
Html Form Enhancements From Scratch
Html Form Enhancements With Plugins
Interface Components From Scratch
User Interfaces With Jquery Ui
Jquery Ui Theming
Jquery, Ajax, Data Formats: Html, Xml, Json, Jsonp
Using Jquery In Large Projects
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.