Jump to:

22999 Posts in 11854 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » [Solved] Straight up, can't get Jquery working

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2529 Views
  • jdi
    Avatar
    Community Member
    34 Posts

    [Solved] Straight up, can't get Jquery working Link to this post

    Hey Guys,

    I'm trying to do things the most authodox way possible. So naturally I'm attempting to call the jquery data from the silverstripe library by following the Jquery documentation:
    http://doc.silverstripe.org/doku.php?id=jquery

    However... it's not really doing anything? Does anyone know any simple jquery scripts that I can use to check that it's working? Otherwise, any common issues with getting jquery to work in silverstripe that you know of?

    Jackson

  • jdi
    Avatar
    Community Member
    34 Posts

    Re: [Solved] Straight up, can't get Jquery working Link to this post

    Test script:

    ;(function($) {
          $(document).ready(function() {
       
        if (jQuery) {
           alert('jQuery is loaded!');
          }

          })
    })(jQuery);

  • banal
    Avatar
    Community Member
    901 Posts

    Re: [Solved] Straight up, can't get Jquery working Link to this post

    You can skip the if statement. This should work:

    ;(function($) {
       $(document).ready(function() {
          alert('jQuery is loaded!');
       })
    })(jQuery);

    If not, there might be a problem with the inclusion of jquery? Mabye multiple versions are being included?
    Check your source-code.

    Edit: Sorry, didn't realize you put a Solved in the title. I thought the script didn't work for you.

    2529 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.