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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

How to use ajax, to load different pages in

Go to End

2 Posts   2738 Views


Community Member, 15 Posts

16 June 2011 at 8:52am

Hi all,

I got a question about the workings of ajax calls within silverstripe. Im trying to load external pages into one page, but so far its failing. What i need to do is get the title, description and images. Im trying to do this through jQuery but i cant get it to work. I think ive forgot something or am just missing something huge. If anyone can help me out that would be appreciated. I tried ajax_recipes but i think its deprecated because i got a warning that a string did not exist.

this is what im trying to do:

$.ajaxSetup ({
cache: false

var ajax_load = "<img src='themes/duskydesigns/images/load.gif' alt='loading...' />";
var url = $(this).attr( 'rel' ) + 'ajax';
alert( url );

Im trying to get the url through the rel wich is just #relativelink of the page in question. Im familiar with javascript but not much with ajax calls and especially not in silverstripe, any help would be appreciated!


Community Member, 72 Posts

17 June 2011 at 7:49am

afaik, ajax_recipes is out of date and deprecated.

I've done many ajax calls pulling in children pages into a "holder" page. and they work fine. I guess I'm "missing something huge" by not seeing all your code. What do you mean by external pages, are you pulling in random pages from your site, child pages, another site's pages?

while your jquery looks fine, I would recommend using .live instead of .click, for a lot of reasons that this forum isn't meant for.
$(".portfolio-product").live('click', function() {
your jquery load stuff here

I would check to see if your function is even being called, by throwing in an alert(); then if so have it load to a static div tag on your page and see if its getting loaded.