Using a local resource from a remote resources will throw exceptions
in many browsers, including chrome. This is what's happening when
accessing http://localhost:65001/d3demo and that page references
file:///C:/temp/d3.v3.min.js

"Not allowed to load local resource: file:///C:/temp/d3.v3.min.js"

The internet seems to agree:
https://www.google.com/search?q=%22Not+allowed+to+load+local+resource%22

I don't know how root works and it seems it is a hack. I can't seem to
find it in the jhs source. I'd would use ~addons or ~root or even
creating an operation on my jpage to output the file.

<script src="http://localhost:65001/d3demo?file=d3.v3.min.js";></script>
or something like that

Or I'd create a jhs page that makes serving static content cleaner

<script src="http://localhost:65001/static?file=d3.v3.min.js";></script>
or something like that. Presumably it'd be possible to create a jhs
page that does nothing more than fread and output the file. May have
to find a way to override the boilerplate content that gets sent down

In production, I wouldn't use J to serve static content. I would put a
reverse proxy in front of J (like nginx) and have it serve the static
content and route requests to J for dynamic content.

I've also thought about continuing my j-forkserver implementation
which can act as a very basic web server. That would be a more "from
scratch" approach which may be easier to work with when needing to get
closer to the metal and outside of the simpler framework that JHS
provides.

Glad to help.

On Sun, Jan 12, 2014 at 10:20 AM, bill lam <[email protected]> wrote:
> Brian,
>
> please note the protocol is file:// not ftp://
>
> If I read correctly Joe's example got the jpath to dereference the ~.  Also
> ~root is hack from jhs, there is no such folder as ~root in SystemFolders_j_,
> so that jpath will not handle ~root.
>
> Вс, 12 янв 2014, Brian Schott писал(а):
>> Bill,
>>
>> If you are talking to me, then I only see the difference between what you
>> suggest and what I tried as the final / in the <base " ... "/>  clause.
>>
>> Otoh, you may be talking about Joe's example which includes a ~ in a <src >
>> element and you may be suggesting that the ~ does really work there. I
>> cannot address that, though, because I have not tried it.
>>
>> No spaces are involved yet, but that could be a later issue. Good point.
>>
>> Thanks,
>>
>>
>> On Sun, Jan 12, 2014 at 9:38 AM, bill lam <[email protected]> wrote:
>>
>> > You probably mean,,
>> >
>> > <base href="file:///Users/brian/j64-701/addons/graphics/d3/">
>> >
>> > Also space (if any) in path should be escaped as %20.
>> >
>> > --
>> (B=)
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> 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