Brian -

The best way to load the file from a local path is to have jhs supply
it to the browser. Otherwise the browser is trying to work in a mixed
local and remote mode.I don't know if it's possible for a base tag or
otherwise to convince it to load a local file using a file:/// link.
For example, Chrome throws a security exception

"Not allowed to load local resource:
file:///C:/users/joe/downloads/j801/addons/graphics/d3/d3.v2.min.js "

'<script src="',(jpath '~addons/graphics/d3/d3.v2.min.js'), '"></script>'

This does seem to work:

<script src="~addons/ide/jhs/js/d3/d3.v3.min.js"></script>

If you'd like to move it out of addons, then you can use the ~root prefix

<script src="~root/temp/d3.v3.min.js"></script>

This would have jhs load it from c:\temp on my computer

I updated the gist https://gist.github.com/joebo/591f52147dfe02efa061
to show this

Does this cover the range of possibilities you are looking for?

Thanks
Joe



On Sat, Jan 11, 2014 at 9:51 PM, Brian Schott <schott.br...@gmail.com> wrote:
> Joe, I am wanting to make the directory local so that the scripts and
> styles can be accessed by name without the directory path needed.
>
> The standard JHS demo's use jhr to replace tags like RESULT in the example
> below. I guess I imagine using jhr with something like PATH. Maybe that is
> silly.
>
> NB. create html page from HBS CSS JS
> NB. HBS body can have TAGS that are replaced
> create=: 3 : 0
> 'canvasdemo'jhr'RESULT';y NB. <RESULT> tag replaced by y
> )
>
>
> d3.ijs uses PATH and HPATH for this, but the PATH is addons, not a generic
> path.
>
>
> Thanks,
>
> --
> (B=)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to