Hi
sorry for that maybe stupid question.
i 've read
http://doc.silverstripe.com/doku.php?id=recipes:ajax_basics
but don't understand this thing totally.
and i didn't do any ajax things before, so i'm a rookie in this area.
(1) what ist this
Director::is_ajax()
call for?
(2) i have some client-script code not originating from silverstripe that want's to be connected to same ajaxified controller functions.
is there any additionally need to do on a controller-function to act as some client-script expects it to be a ajax-pendant?
(must there be some protocol-header set or anything else)
do i have to include this
Requirements::javascript('mysite/javascript/jquery.js');
if i don't do things for silverstripe ajaxified controls?
let's say, that if i don't need any template rendering things.
so i thought the simplest solution was to return the strings i need.
fe:
class mycontroller xxx
function getSomethingsContent() {
$ds = DataObject::get(yyy...);
return "<div id = 'blabla'>$ds->Content<div>";
}
is this a good solution or not?
if i call this thing in the webbrowser via url it seems to be ok.
if i call it out of a javascript to replace someones innterhtml i have problems
if this thing hase special HTML characters.
they come as XML where they should be HTML... which leeds to javascript-errors
what i don't understand is, what system-part does this xml-translation thing, if i don't use that template rendering mechanism?
Do i have to call another function to encode to another format?
(3) now for the stupid php question:
i've seen this thing sometimes in code, but can't the hell figure out what it does.
(try to search for <<< in google. aaarghhh...)
$ret = <<<HTML
<div id="Form_ResultForm">
{$form->renderWith("Form")}
</div>
HTML;
i think it does something like format it ready for HTML.
but i'm not sure, might also only be some php-syntax construct to allow many lines
of text to be entered in a friendly way.