On Thu Sep 09, 2010 at 20:49:27 +1000, Ben Finney wrote:
> I've followed the instructions in the README.Debian for ???libjs-jquery???
> to use it from HTML files generated by ???python-coverage???, but without
> success.
Right, I think your specific use-case is non-standard and doesn't
really match what the available documentation.
> Using the attribute ???src="/javascript/jquery/jquery.js"??? failed; the
> script silently fails to load. I could onyl get it to work with
> ???src="/usr/share/javascript/jquery/jquery.js"???.
This makes sense - because you're not expecting to serve the
file via HTTP, but instead via a local file-system access.
Your solution is correct:
* Load via filesystem path, rather than by the URL, from beneath
/usr/share/javascript/.
> What is the expected context for following the instructions in the
> ???libjs-jquery??? README.Debian? Could that document be updated to be
> explicit about what that context is, and perhaps the limitations of
> where that advice holds true?
In 99% of cases, where the library is intended to be included by a
file fetched via HTTP, the documentation is correct as-is.
Its only if you're trying to load jQuery via something that doesn't
use a web-server, and is instead found on the filesystem, that we
need to document the solution.
> Rather, the tool generates an HTML report which, in the upstream code,
> gets the jQuery library copied into every such report. The HTML
> documents then reference the jQuery libraries directly from the same
> directory, with the intention that the report directory can be moved
> anywhere, even to a different machine, and still work since the jQuery
> libraries stay with the report.
To handle that I'd almost suggest making a code-change. Linking
/usr/share/javascript/jquery/jquery.js to the directory of the
output - and then loading <script src="jquery.js"></script> - such
that if the directory is moved the source still works,.
Steve
--
Let me steal your soul?
http://stolen-souls.com
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]