jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. jQuery’s syntax is designed to make it easier to navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications.
When you want to display code, you are probably using PRE elements. The fact that these elements can contain markup makes them perfectly suited for syntax highlighting. Some plugins make it easier to copy the code using a button. Google Prettify has no such option. Let’s see if we can make copying easier by providing a “double click to select all”-feature to our pre fields.
Doing calculations on Knockout data-binds might result into a “Uncaught SyntaxError: Unable to parse bindings” error. Solution: use an anonymous function!
While working with the Chrome Developer Tool, I’ve discovered that you can retrieve the XPath of a selected node. But… it only works in Chrome. So what about other browsers? What about jQuery? What about querying documents that resulted from an AJAX request?