Difference between revisions of "Loading jQuery for instrumenting pages"

From Market Ruler Help
Jump to: navigation, search
(Created page with 'The <span class="code">__CR.jquery</span> function takes a single parameter which is a callback which has the first parameter the jQuery global (typically '''window.jQuery'''…')
 
(No difference)

Revision as of 19:02, 30 June 2016

The __CR.jquery function takes a single parameter which is a callback which has the first parameter the jQuery global (typically window.jQuery or window.$).

The current version of jQuery which is loaded is 1.11.3. It is only loaded if jQuery is not detected on the page. Detection checks for the existence of the window.jQuery variable being defined.

An example of its usage is:

<script>
window._crq = window._crq || [];
window._crq.push(function (cr) {
    cr.jquery(function ($) {
        // Do jQuery stuff here using $ as the loaded version of jQuery
    });
});
</script>

For more information, read the jQuery documentation.

See also