Re: Pushing Javascript Helper to external file.

Michael Schuerig
Tue, 11 Oct 2005 18:16:12 -0000

On Tuesday 11 October 2005 19:24, Rube wrote:
> I just copied the result of remote_function.  Anyhow, as you can
> probably tell this is going to cause a problem if my app is deployed
> to a subdirectory, say /inventory, then the Ajax.Updater should call
> ''/inventory/store_room/get_note'' + id, but it
won''t.  I need that
> :url magic in my external .js file.

No magic, but two suggestions

1) define a JavaScript variable urlPrefix in your main layout
2) include a config script where you define such a prefix

Michael

--
Michael Schuerig               Most people would rather die than think.
mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org
In fact, they do.
http://www.schuerig.de/michael/                      --Bertrand Russell