JS

Archived from the Xataface Users forum.

cantlep — Tue May 25, 2010 5:28 am

Hi Steve,

If I wanted to use this functionality in my app. Where would I need to put the respective code and js file?

http://www.dynamicdrive.com/dynamicinde … ndency.htm

Thanks

Paul


shannah — Tue May 25, 2010 8:29 am

I generally store it in a separate javascript file, then use the custom_javascripts block to include the script.
e.g.

Code: Select all
function block__custom_javascripts(){     echo '<script src="js/myscript.js"></script>'; }

cantlep — Tue May 25, 2010 8:40 am

Excellent, cheers.

What about the actual code for the page though. Does that need another block?

Thanks

Paul


shannah — Tue May 25, 2010 9:16 am

You should be able to put most of the stuff in one or two javascript files that you include by a block/slot of your choice. You can always see which blocks are available by adding debug=1 to the beginning of your conf.ini file.