I am trying to create a simple widget that people can add to their
site with one script tag, like the following:
The action is an RJS that renders some HTML at that spot (like a
page.insert_html :top, :widget_div, :partial => ‘widget_partial’
The issue is that the regular Prototype libraries are not included
yet, so there is an error when it tries to get ‘element’.
If I include the Prototype libraries in one of my own test pages it
works the way it should, but I can’t depend on someone adding those
libraries and want to try to make it as ‘drop in’ as possible.
Any thoughts on how I can ‘bootstrap’ Prototype in this type of
scenario? Does anyone have tips on how to achieve something like this
in another way?
Thanks in advance for any help.