jQuery's getScript and the local file system-- limitations/alternatives?

Posted by user210099 on Stack Overflow See other posts from Stack Overflow or by user210099
Published on 2010-05-22T00:20:00Z Indexed on 2010/05/22 0:20 UTC
Read the original article Hit count: 460

Filed under:
|

Right now I'm working on a help-system which is based on a local file system. It is intended to be shipped with a product which is not used on internet-enabled machines, so it must be a stand alone webpage, without any dependencies on a web server.

This introduces a few challenges. Namely, the directory structure that the files exist in require navigating "up and over" to access some .js files which are required to display the help system. This use to be implemented using the jQuery getScript function, but I have ran into some problems using this on the local file system.

At first glance, it seemed that if my webpage was being served out of the C:/dev/webpage/html/ directory, and the files I needed were in C:/dev/webpage/js/(topic)/file.js, I could just build an absolute path (file:///...) and pass that into the getScript function.

However, after testing this, it does not seem that the getScript function will let me go up a level from the html directory (where the html file is located which has the main code for the webpage). Unfortunately, I can not change the directory structure, nor can I change the .js file structure/format.

Is there an alternative for loading/executing javascript files that are in a file structure where I need to go "up and over"?

Thanks,

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript