[TYPO3-mvc] Date examples, can't find any.

Nathan Lenz typo3 at k9tfk.com
Thu Jan 14 20:14:16 CET 2010


Martin Kutschker wrote:
> Franz Koch schrieb:
>> As for the JS stuff etc. Martin, Sebastian and I had recently a small
>> discussion here on this list on how common JavaScript libraries and
>> AJAX-features could be implemented in FLUID - maybe as viewHelper or
>> whatever.
> 
> I think a nice way would be to have a few view helpers within FLUID that are only "abstract
> widgets". You would have to install another extensions/package for jQuery, ExtJS etc to bring them
> to life. Dependinging on the JS framework the rendered code would be simple HTML with some "magic"
> CSS classes or embedded JS code. The concrete widget extension would also be responsible for loading
> all the required JS code *.
> 
> Masi
> 
> * In case you want to load manual loading (eg via Typoscript) then you must be able to disable the
> automatic inclusion of the JS lib files.

It might be nice if the view helper that does the including of the
javascript knew enough to include the JS in the appropriate place using
the latest in javascript loading techniques.

http://www.stevesouders.com/blog/2009/04/27/loading-scripts-without-blocking/

<f:javascript src="myjsfile/bla.js" location="head" />

Would just add it into the <head> tag.

<f:javascript src="blalla/foot.js" location="bottom" />

Would put it into the very bottom of the page.  Not sure if this is
possible without  modifying the layout to include it before </body>

<f:javascript nonblockingmethod="xhrInjection"
src="myjsfile/goeshere/yea.js" />

This would download the script via XMLHttpRequest and inject it into the
page.

<f:javascript nonblockingmethod="scriptDOMElement"
src="myjsfile/url/here.js" />

This would create a script element in the dom and set it's src property
equal to the url of the js file.




Another approach could be asking if the js is needed in order to
initially render the page, otherwise it would automatically go into the
footer.  So hiding the technical methods and just asking for the
requirements and making the best decision.

<f:javascript when="immediate" src="bla.js" />
<f:javascript when="onload" src="include/jquery.js"></f:javascript>

--Nathan







More information about the TYPO3-project-typo3v4mvc mailing list