Javascript Queue Sprint plugin
Plugin details
Documentation
ruby script/plugin install http://jsqueuespring.googlecode.com/svn/trunk/js_queue_spring/
Standard usage... executes JS page after page has loaded, similar to javascript_tag:
<% queue_js do << -STRING alert('Here I am, loading when the page is done.'); STRING end %>
Would wrap the alert in tags (and the CDATA crap), and then execute it when the page was done loading.
Note that you can (obviously?) call queue_js as many times as you like. The call will queue all JS until unqueue_js is called (which automatically happens at the end of any render call)
Alternately, you can also use pass :flat as a parameter to queue_js if you don't want your JS to automatically be executed, i.e.,
<% queue_js(:flat) do << -STRING function someLocalFunction() { alert("I won't be executed until somebody calls me"); } STRING end %>
All JS queued with the flat parameter will be added to the page before JS that will execute, so you can declare functions in the :flat areas that are called in the executed areas.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (2 older versions) | Last edited by: hardway, 4 months ago

