WordPress.org

Forums

Including a JQuery file (easy question) (5 posts)

  1. Kurren123
    Member
    Posted 2 years ago #

    Hi Everyone
    I tried following tutorials but none really explain what I want to do. I am aware that wordpress uses jquery in "noconflict" mode so every $ sign needs to be replaced with "jQuery" or the entire script needs to be replaced with a wrapper of some sort.

    However there is a js file, call it example.js, that is quite big. I am not allowed to alter this file (so can't put it in a wrapper or change all the $ signs) and this js file uses jQuery. I only need to include this file on one particular page on my site.

    How can I include example.js?

    Thanks in advanced for your help

  2. Serge
    Member
    Posted 2 years ago #

    Maybe this Codex info about Using Multiple Javascript files inside one post of page might help?

  3. Kurren123
    Member
    Posted 2 years ago #

    That link is to simply include javascript files. But it still cannot read standard jquery :(

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    so can't put it in a wrapper or change all the $ signs

    Then, as far as I know, you can't use this file on a WordPress site. :-(

  5. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    You don't have to replace every instance of the dollar symbol, but only in the function instantiation.
    E.g

    jQuery(document).ready(function($) {
     // $your code
     // $your code
    });

Topic Closed

This topic has been closed to new replies.

About this Topic