In a plugin I wrote, I put a <div> like this at the bottom of the
page:
<div id="ajaxurl" style="display:none;">$
{href.updates('ajaxSaveTableChange')}</div>
Then I used Javascript and getElementById (well, really I use $
('#ajaxurl').text(), but either will work) to read the url that Genshi
made for me. In this way, the Javascript itself doesn't have to be
dynamic, but the URL can still be.
Similarly, you could use some sort of postprocessor or something to
add such a div to pages if you didn't want to edit templates directly.
Also, if anyone has a better approach, I'd be interested as well.
-Nikolaus
On Sep 12, 12:25 pm, Jeff Hammel <[EMAIL PROTECTED]> wrote:
> I'm working on a plugin (which I also intend to propose as a patch) that will
> autocomplete users on ticket fields (assign to, CC) via AJAX. I've created a
> request handler for '/users' which returns user information in the format
> that I need. But I'm not sure if there is a good way to specify this URL in
> JS. For '/newticket' I can use 'users', but for '/ticket/1' I have to use
> '../users', which leads to the necessity of either having two JS files with
> similar contents (maybe not horrible) or generating the JS dynamically.
>
> I can't use '/users' AFAIK as the absolute link should be
> '/myprojectname/users'. Is there a way around this in trac? Or is
> dynamically generating the JS the only approach here?
>
> Jeff Hammel
> The Open Planning Projecthttp://topp.openplans.org
> IRC: jhammel, k0s
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---