3212 Posts in 847 Topics by 809 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 965 Views |
-
500 Server Error when trying to load template via Ajax

22 October 2010 at 4:45pm
Hello, am getting a 500 Internal Server error in Firebug when I try to load a .ss template via Ajax. I'm following the Ajax basics recipe to a T.
Any ideas?
-
Re: 500 Server Error when trying to load template via Ajax

22 October 2010 at 5:21pm
Put the site in dev mode or look at your server error logs.
-
Re: 500 Server Error when trying to load template via Ajax

22 October 2010 at 7:44pm
Its been in dev mode the whole time and the error logs aren't showing anything out of the ordinary.
-
Re: 500 Server Error when trying to load template via Ajax

23 October 2010 at 12:17am
Well thats strange, can you track it down to a specific line (by commenting out code). Post some more information about the function. What happens when you hit the url directly rather than via with ajax.
-
Re: 500 Server Error when trying to load template via Ajax

26 October 2010 at 10:36am
Here's the function:
function showArticleImages() {
if($this->isAjax) {
if($photos = DataObject::get("Photo", "ProfileID = {$this->ID}")) {
return $this->customise(array(
'Photos' => $photos
))->renderWith('articleImages');
} else {
return "Oops, you don't have any photos uploaded yet. <a href=\"{$this->Link('newPhoto')}\" onclick=\"confirmExit('{$this->Link('newPhoto')}'); return false;\">Click here to upload some</a>.";
}
} else {
return Array();
}
}When I go to the page url directly, it just displays the parent page template. Template file, articleImages.ss, is residing in the templates folder next to the top-level Page.ss so that it doesn't pull the header or footer in.
The Ajax works fine though, no problem with that.
| 965 Views | ||
|
Page:
1
|
Go to Top |


