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

$(...).loadFragment is not a function


Go to End


867 Views

Avatar
ismooth

Community Member, 25 Posts

7 November 2014 at 12:57am

Hi,

i'm trying to get PJAX loadFragment to work, but I got stuck at the begining. I added pjaxNegotiator callback in TestAdmin (extends ModelAdmin), and set data-pjax-fragment attribute on the element I want to replace, but I get following error:

TypeError: $(...).loadFragment is not a function
$('.cms-container').loadFragment('admin/tests/', 'VulnerabilityInfo');

Looking at the events attached around the DOM tree of the document, there isn't anywhere that event attached to any element (not even .cms-container div).

What am I missing here? I followed instructions at http://doc.silverstripe.org/framework/en/trunk/reference/cms-architecture#loading-lightweight-pjax-fragments but it's not working.