<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Forum posts to 'Extending and hacking'</title>
		<link>http://www.silverstripe.com/extending-hacking-silverstripe-forum/</link>
		

		
		<item>
			<title>Re: AJAX and maybe stupid php question...</title>
			<link>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581?showPost=75086</link>
			<description>Hi Grayzag&lt;br /&gt;&lt;br /&gt;THX for (3) :-))) makes things clearer for me&lt;br /&gt;(1) would be interesting to me, how this was implemented.&lt;br /&gt;Are there other protocols used, where they take out this info?&lt;br /&gt;but might look myself in code to find out ;-)&lt;br /&gt;&lt;br /&gt;(2). I'd some problems understanding the sample in&lt;br /&gt;http://doc.silverstripe.com/doku.php?id=recipes:ajax_basics&lt;br /&gt;the most confusing part for me was that the index-function uses&lt;br /&gt;[code]&lt;br /&gt;  return $this-&amp;gt;renderWith(&quot;ajaxSnippet&quot;);&lt;br /&gt;[/code]&lt;br /&gt;where i expected to see this thing happen in an usual function.&lt;br /&gt;it seems to show some image that has been uploaded, &lt;br /&gt;where me is missing any image-upload code???&lt;br /&gt;for the xml-thing. i think i'll try rendering via snippet, as shown in the sample. &lt;br /&gt;is maybe a better solution then have things in code...&lt;br /&gt;[UPDATE]&lt;br /&gt;addon to my 'javascript' error.&lt;br /&gt;my client-script sets xxx.innerHTML = s;&lt;br /&gt;where it gets s from my controller-ajaxified-function.&lt;br /&gt;this produces an javascript error (in Firefox)&lt;br /&gt;[code]&lt;br /&gt;An invalid or illegal string was specified&lt;br /&gt;[/code]&lt;br /&gt;the funny thing is that actually me using&lt;br /&gt;[code]&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&amp;gt;&lt;br /&gt;[/code]&lt;br /&gt;.innerHTML should not be valid to use&lt;br /&gt;if you look at&lt;br /&gt;http://www.webdeveloper.com/forum/showthread.php?s=b1e88d910c127646d403a781adc14742&amp;amp;t=178347&amp;amp;page=2&lt;br /&gt;they say someone shall use: createElementNS()&lt;br /&gt;But it seems to work, if there are no special characters inside. only with bad chars fe. &lt;br /&gt;[code]&amp;amp;szlig;[/code] i get this script-error in firefox(maybe in ie too?)&lt;br /&gt;&lt;br /&gt;AAARGHHH... &lt;br /&gt;wondering how silverstripe is doing this (have to look at JQuery)...&lt;br /&gt;&lt;br /&gt;g&lt;br /&gt;  Helmut&lt;br&gt;&lt;br&gt;Posted to: AJAX and maybe stupid php question...</description>
			<pubDate>Sun, 18 May 2008 21:00:31 +1200</pubDate>
			<author>Helmut Zörrer</author>
			<guid>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581?showPost=75086</guid>
		</item>
		
		<item>
			<title>Re: AJAX and maybe stupid php question...</title>
			<link>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581?showPost=74896</link>
			<description>Hi Zyko,&lt;br /&gt;&lt;br /&gt;in response to your questions: Director::is_ajax() is used to tell if the SilverStripe instance running has been called by an ajax request, rather than just a normal HTTP request. With the &amp;lt;&amp;lt;&amp;lt; thing, it means that you can specify a custom endpoint for your string, that is instead of:&lt;br /&gt;&lt;br /&gt;[code]&lt;br /&gt;$string = &quot;bla&quot;;&lt;br /&gt;[/code]&lt;br /&gt;&lt;br /&gt;you can use:&lt;br /&gt;[code]&lt;br /&gt;$string = &amp;lt;&amp;lt;&amp;lt;bla&lt;br /&gt;this is all&lt;br /&gt;the string contents&lt;br /&gt;bla;&lt;br /&gt;[/code]&lt;br /&gt;&lt;br /&gt;Basically it tells PHP to keep reading the string in until it finds an instance of bla at the beginning of a line (or whatever delimeter you specify after &amp;lt;&amp;lt;&amp;lt;).&lt;br /&gt;&lt;br /&gt;As for the special characters, im not 100% sure, but maybe you could try replacing the return with an echo (not a good coding practice - but just as a test) to see if that works.&lt;br&gt;&lt;br&gt;Posted to: AJAX and maybe stupid php question...</description>
			<pubDate>Sun, 18 May 2008 13:57:12 +1200</pubDate>
			<author>Andrew Short</author>
			<guid>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581?showPost=74896</guid>
		</item>
		
		<item>
			<title>AJAX and maybe stupid php question...</title>
			<link>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581</link>
			<description>Hi &lt;br /&gt;&lt;br /&gt;sorry for that maybe stupid question.&lt;br /&gt;i 've read&lt;br /&gt;http://doc.silverstripe.com/doku.php?id=recipes:ajax_basics&lt;br /&gt;but don't understand this thing totally.&lt;br /&gt;and i didn't do any ajax things before, so i'm a rookie in this area.&lt;br /&gt;&lt;br /&gt;(1) what ist this&lt;br /&gt;Director::is_ajax()&lt;br /&gt;call for?&lt;br /&gt;&lt;br /&gt;(2) i have some client-script code not originating from silverstripe that want's to be connected to same ajaxified controller functions.&lt;br /&gt;is there any additionally need to do on a controller-function to act as some client-script expects it to be a ajax-pendant?&lt;br /&gt;(must there be some protocol-header set or anything else)&lt;br /&gt;do i have to include this&lt;br /&gt;Requirements::javascript('mysite/javascript/jquery.js');&lt;br /&gt;if i don't do things for silverstripe ajaxified controls?&lt;br /&gt;&lt;br /&gt;let's say, that if i don't need any template rendering things.&lt;br /&gt;so i thought the simplest solution was to return the strings i need.&lt;br /&gt;&lt;br /&gt;fe:&lt;br /&gt;[code]&lt;br /&gt;class  mycontroller  xxx&lt;br /&gt;  function getSomethingsContent() {&lt;br /&gt;    $ds = DataObject::get(yyy...);&lt;br /&gt;    return &quot;&amp;lt;div id = 'blabla'&amp;gt;$ds-&amp;gt;Content&amp;lt;div&amp;gt;&quot;;&lt;br /&gt;  }&lt;br /&gt;[/code]&lt;br /&gt;is this a good solution or not?&lt;br /&gt;&lt;br /&gt;if i call this thing in the webbrowser via url it seems to be ok.&lt;br /&gt;if i call it out of a javascript to replace someones innterhtml i have problems&lt;br /&gt;if this thing hase special HTML characters. &lt;br /&gt;they come as XML where they should be HTML... which leeds to javascript-errors&lt;br /&gt;what i don't understand is, what system-part does this xml-translation thing, if i don't use that template rendering mechanism?&lt;br /&gt;Do i have to call another function to encode to another format?&lt;br /&gt;&lt;br /&gt;(3) now for the stupid php question:&lt;br /&gt;i've seen this thing sometimes in code, but can't the hell figure out what it does.&lt;br /&gt;(try to search for &amp;lt;&amp;lt;&amp;lt; in google. aaarghhh...)&lt;br /&gt;&lt;br /&gt;[code]&lt;br /&gt;$ret = &amp;lt;&amp;lt;&amp;lt;HTML&lt;br /&gt;&amp;lt;div id=&quot;Form_ResultForm&quot;&amp;gt;&lt;br /&gt;{$form-&amp;gt;renderWith(&quot;Form&quot;)}&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;HTML;&lt;br /&gt;[/code]&lt;br /&gt;&lt;br /&gt;i think it does something like format it ready for HTML.&lt;br /&gt;but i'm not sure, might also only be some php-syntax construct to allow many lines&lt;br /&gt;of text to be entered in a friendly way.&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;Posted to: AJAX and maybe stupid php question...</description>
			<pubDate>Sun, 18 May 2008 00:00:59 +1200</pubDate>
			<author>Helmut Zörrer</author>
			<guid>http://www.silverstripe.com/extending-hacking-silverstripe-forum/show/74581</guid>
		</item>
		

	</channel>
</rss>
