Grow your CSS skills. Land your dream job.

!window.jQuery.ui Problem in WordPress

  • # November 5, 2012 at 12:23 pm

    I am working on a WordPress website, and I need to include this to a page. BUT there is this code that does not let me integrate it.

    <script>!window.jQuery && document.write(unescape(‘%3Cscript src="js/jquery-1.7.2.min.js"%3E%3C/script%3E’))</script>

    Any idea how to make it work in WordPress?

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script&gt;

    <script>!window.jQuery && document.write(unescape(‘%3Cscript src="js/jquery-1.7.2.min.js"%3E%3C/script%3E’))</script>

    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script&gt;

    <script>!window.jQuery.ui && document.write(unescape(‘%3Cscript src="js/jquery-ui-1.8.21.custom.min.js"%3E%3C/script%3E’))</script>

    <script src="js/jquery.mousewheel.min.js"></script>

    <script src="js/jquery.mCustomScrollbar.js"></script>

    <script src="js/scrollbar.js"></script>

    Thanks,

    # November 12, 2012 at 6:37 am

    Have you tried any of these options? **remove the spaces from my script tags**

    < script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" >< /script >
    < script >window.jQuery || document.write("

    or use javascript...

    (function test_jQuery() {
    if (!window.jQuery) {
    var script = document.createElement('script');
    script.src = "js/jquery.js";
    document.getElementsByTagName('head')[0].appendChild(script);
    }
    if (!window.jQuery.ui) {
    var script_ui = document.createElement('script');
    script_ui.src = "js/jquery-ui.js";
    document.getElementsByTagName('head')[0].appendChild(script_ui);
    }
    })();

    You dont need the anonymous function, its just habit for me.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".