Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

[Solved] Straight up, can't get Jquery working


Go to End


3 Posts   3203 Views

Avatar
Jakxnz

Community Member, 36 Posts

23 February 2010 at 12:43pm

Edited: 23/02/2010 2:14pm

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

Avatar
Jakxnz

Community Member, 36 Posts

23 February 2010 at 2:14pm

Test script:

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

Avatar
bummzack

Community Member, 904 Posts

23 February 2010 at 7:36pm

Edited: 23/02/2010 7:50pm

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.