Focal Point
Using JS

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6521045261

April 06, 2006, 04:58 PM
Mike Johnson
Using JS
I have placed some JS code in the OtherFiles directory. I'm using Dev Studio MRE 5.2.3. I need to know how to reference the image files. All of the images the JS uses is located in OterFiles. Thanks
April 06, 2006, 05:21 PM
<Tim Howard_ABCBS>
The HTML, Maintain, Master Files, Other and Procedures directories are just virtual folders. Your image files are actually in the same directory as your html file:

http://server/approot/sampapp

You should be able to access them directly.

myImage = new Image();
myImage.src = "image.jpg";

You can also use the full path:

myImage.src = "http://server/approot/sampapp/image.jpg";
April 11, 2006, 02:09 PM
Mike Johnson
I have this code in a HTML launch page. The image is not being displayed. Any Ideas.

var img = document.createElement('IMG');
img.src = 'app/down.gif';
April 12, 2006, 02:07 PM
<Tim Howard_ABCBS>
Since the files are physically located in the same directory, you should not need to prefix it with the 'app' directory.

EX:
img.src = 'down.gif';

Try removing the 'app' directory and see what happens.
April 12, 2006, 02:16 PM
Mike Johnson
I've tried that without success. I've also tried using the full path as you mentioned before.

Is there any settings in the setup of web-focus that would prevent this from working?
April 13, 2006, 11:33 AM
<Tim Howard_ABCBS>
Try using this path:

EX:
img.src = '../approot/sampapp/down.gif'
April 18, 2006, 05:12 AM
Tony A
Mike,

I have found (over the years) that referencing image files (or JS and/or any other files) is somewhat hap-hazard and is it is best to place them on the web server and reference them accordingly.

On your web server install of WF (aka the "client" server) you should have the IBI directory. A sub directory of this is APPS and is internally referenced by WF as APPROOT (via one of the config files). As this is the same for any installation, having code like -
<img src=/approot/baseapp/imagefil.jpg border=0>
will ensure that your code is tranportable between installations.

If you want to have specific folders for images, javascript, cascading style sheets etc. then just set them up under the APPS folder and reference them as in the code above.

More maintainable and easier to remember!! Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 20, 2006, 08:29 AM
Mike Johnson
Tim, Thanks for all your help. My support team was finaly able to Figure out how to make this work. I wish I could explain it but I can't because at this point I have no idea why it works. I know it has something to do with the web server. I don't have access to the server so some other method was used to tell focus where the image files where located. Again Thanks.

When I figure out how this works I will make another post.