DOMQuery

The built-in DOMQuery object provides a useful subset of jQuery's features without any overhead or compatibility issues.

Using DOMQuery instead of jQuery is as simple as... $ = DOMQuery;

...or if your page needs to work in both web.dev.app and other browsers then... <script src='jquery.js' dev:src=''></script> <script> var $ = DOMQuery ? DOMQuery : jQuery; </script>

...which uses dev:src to overwrite the src attribute and disable the <script> tag only in web.dev.app.


The DOMQuery object is incomplete. Most of the DOM manipulation functions are working, but a few functions will give an "unfinished feature" warning, and no ajax or animation functions have been implemented yet.

Example
<style> p { background: yellow; margin: 6px 0;} p.orange { background: orange;} </style> <p>Click to toggle background</p> This text stays in place <p>Click to toggle background</p> <button>Attach/detach paragraphs</button> <script> var $ = DOMQuery; $("p").click (function(){ $(this).toggleClass ("orange");}); var p; $("button").click (function(){ if (p){ p.appendTo ("body"); p = null;} else { p = $("p").detach();}}); </script>

Click to toggle background

This text stays in place

Click to toggle background