newLISP on Rockets comes with and works with jQuery, which lets you do all sorts of wild and wonderful things on your page. But where should you put your Javascript code?
It doesn't really matter where it goes as long as there are <script> tags around it, but sometimes you want to defer execution to the end of the page. This leads to the best performance, because the user isn't waiting for the Javascript to load before seeing the page elements.
I've modified (display-footer) to let you add a string of Javascript or jQuery code to your page and insert it right at the end. You assign the code to a string variable and then just call (display-footer "Your name" name-of-string-variable) and it will execute the Javascript or jQuery code at the end of the page.
Views: 6527