This question about Using an extension: Answered
get attachURL in javascript
I have a page with 2 attachments; the first is javascript (using jquery and run from the main page), and the 2nd is a data file the javascript uses.
How do I reference the data file from my javascript, specifically for $.get()?
This would be done via %ATTACHURL% in a wiki page. My understanding is the foswiki object is supposed to have this kind of thing, but it looks as if the closest is foswiki.puburl, which will need a lot of extra processing (maybe strip out /pub, add sandbox and then topic).
Also puburl seems to have changed from foskwiki 1.0.4; that version didn't have a /pub at the end. I am targetting a site with that version, but am trying to develop on the foswiki.org sandbox because of caching problems (still unanswered
http://foswiki.org/Support/Question651).
Thanks.
--
RossBoylan - 07 Oct 2010
You could use '%ATTACHURL%/data_attachment' as an arguement to the function run from the main page.
--
DavidPatterson - 11 Oct 2010
JQueryPlugin populates
meta
with a bunch of useful preferences that can be used to create a request URL. Vuiew source of your page in a browser and inspect the
meta
tags to see what's available.
--
CrawfordCurrie - 14 Feb 2012