Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Issue with path for js file

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657

    Issue with path for js file

    I'm just starting to do some work with Java script for the 1st time, using Jointjs.

    To test things I created a fiolder inside of my apps folder called dist.

    In this I had the files for jointjs and this worked fine.

    As I want to share these files with other apps I created a folder under Library called jointjs and put a copy of the file in there

    from a js file in my app folder if I use:

    <script src="./dist/joint.js"></script>

    it works fine

    If I use:

    <script src="../library/jointjs/joint.js"></script>

    it does not

    Can anyone tell me where I'm going wrong with this?

  2. #2
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    What type of file did you put the script tags in and where is it located? You can right click on a webview and activate the web inspector to help debug your code.

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    They are in a rsp file

    it is a javascript file joint.js

    It is located at C:\Lianja\library\jointjs\joint.js

  4. #4
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    Where is the .rsp file located?

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    in the apps own directory c:\Lianja\apps\erd4lianja\erd4lianja_main.rsp

  6. #6
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    Quote Originally Posted by avianmanagement View Post
    in the apps own directory c:\Lianja\apps\erd4lianja\erd4lianja_main.rsp
    ok then look in the web inspector, javascript error console. Because its in a subfolder that will be the base url so you need to use ../../library

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    Thank you it works now when I use

    <script src="../../library/jointjs/joint.js"></script>

    I know nothing about this stuff and just used the path that was in another post on subfolders in library

    http://www.lianja.com/community/show...-under-Library

    I had assumed that ../ meant step back two levels from when I am now.

  8. #8
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    The thing to remember is that the absolute directory of the file executing becomes the default directory so you need to use relative urls inside the file.

  9. #9
    Senior Member
    Join Date
    Apr 2012
    Location
    United Kingdom
    Posts
    657
    So if I am in a file c:\Lianja\apps\erd4Lianja\erd4lianja_main.rsp

    ../ would take me to c:\Lianja\apps ?

  10. #10
    Lianja Support Team lianjasupport's Avatar
    Join Date
    Feb 2012
    Location
    Boston USA, Wokingham UK
    Posts
    1,259
    Yes. Up one level from the folder containing the file.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us