locked
Is jQuery include in master page not enough for the whole site ? RRS feed

  • Question

  • I have customized master page by including jQuery and set it as the master page for Site and System master page.

    <script type="text/javascript" src="/_layouts/1033/jQuery/1.4.2/jquery-1.4.2.min.js"></script>

    Now when I tried to add some jQuery script in CEWP and execute, it is not running. When I included script src to jquery inside CEWP, the script worked fine.

    I was under the impression that if jQuery is included in master page, then you do not need to include it on pages specifically. Is this not true ?

    Friday, March 11, 2011 4:27 PM

Answers

  • My mistake. It is working. I forgot to put  the code inside $(document).ready(function(){ });

    • Marked as answer by vmrao Monday, March 21, 2011 5:21 PM
    Monday, March 21, 2011 5:21 PM

All replies

  • > I was under the impression that if jQuery is included in master page, then you do not need to include it on pages specifically. Is this not true ?

    I think so. If it's in the master page, you should be able to use it.

     

    > Now when I tried to add some jQuery script in CEWP and execute, it is not running. When I included script src to jquery inside CEWP, the script worked fine.

    Where in the master page did you add this script source? I haven't done something like this, but try adding it where the "core.js" is located. I believe "core.js" is used in every pages.

     

    Hope that helps...

     


    Pman
    http://www.pmansLab.com/
    Saturday, March 12, 2011 5:18 PM
  • My mistake. It is working. I forgot to put  the code inside $(document).ready(function(){ });

    • Marked as answer by vmrao Monday, March 21, 2011 5:21 PM
    Monday, March 21, 2011 5:21 PM