SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can link to forexample.js but not relative or full path

    i've got a script and i need to assign a value to an external file or two. mymenu_data.js works (src="mymenu_data.js") but /menu/mymenu_data.js doesn't and neither does http://paramountcourier.com/menu/mymenu_data.js

    any idea why, or how i can get around this please?

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when i looked in the directory for the 'menu' folder, there was no file named "mymenu_data.js". there was a file named "menu_data.js". could this be the problem?

  3. #3
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no. i changed the name, but it should be completely consistant.

  4. #4
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whatever you did seemed to have worked. when i posted my first message i got a 404 error for the link that you posted. when i click the link now, it works. is your relative path still not working?

  5. #5
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol. all i did was change the filename.

    im trying to get the SCRIPT to recognize the filepath, not as a link, but as a part of the SCRIPT! lol
    (go to www.paramountcourier.com and hover over the orange nav bar. you get a javascript error. see?)

  6. #6
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aaaahhhhh. can you post some of your code?

  7. #7
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there's two MAIN parts of the script. mymenu_data.js is my data, while dqm_script is what makes it work.

    i should only have to assign these paths within the html, though, like so:

    Code:
    <script language="JavaScript1.2" src="http://paramountcourier.com/menu/menu_data.js"></script>
    <script language="JavaScript1.2" src="http://paramountcourier.com/menu/dqm_script.js"></script>
    or

    Code:
    <script language="JavaScript1.2" src="/menu/menu_data.js"></script>
    <script language="JavaScript1.2" src="/menu/dqm_script.js"></script>
    neither of those work. this does, but i can't place the files where i want then.

    Code:
    <script language="JavaScript1.2" src="menu_data.js"></script>
    <script language="JavaScript1.2" src="dqm_script.js"></script>

  8. #8
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i looked at both of your .js files. this may be a stupid question, but where do you define showMenu()? I didn't see it defined anywhere.

  9. #9
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this may be a stupid answer, but i have no idea. i didn't write the script, lol.

    they're probably in one of the other files. there's a separate file for each of the possible browsers for viewing. they should be referenced from dqm_script.js

    Edit:

    it works, trust me . it's fine until you want to move the files

  10. #10
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    o.k., i found it. it builds the script based on browser type. this ones got me stumped. the script is tricky to read and would take some time to go through. if i wasn't at work i could give it a little more time.

  11. #11
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright. well thanks for the help. maybe it just can't be done...

  12. #12
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see that you kind of got it working, I assume by moving the files out of the folder. If you want to try to move the files back to that folder, I think I know how to do it...assuming you put them back into the folder named "menu"..

    Try this:

    In the file "mymenu_data.js", there is a variable named 'DQM_codebase'. it is currently set equal to nothing, change this so that it is set like this:

    DQM_codebase = "http://www.paramountcourier.com/menu/";


    The issue is that the script builds the path dynamically. The default method works if you put your .js files in whatever directory your page is in. To change the structure, i think you just need to update this variable. In fact, if all of your files are in your main directory, you could also probably do this:

    DQM_codebase = "menu/";

    Or, if all of your files are in a separate directory one off from the main directory, this will work:

    DQM_codebase = "../menu/";

    If you don't want to mess around, just go with the absolute path at the top, that should work. If you try these and they don't work, try stripping the '/' off of the end.
    Last edited by makeda; Feb 13, 2002 at 08:08.

  13. #13
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope. haven't gotten it working yet. you see, i seem to only be able to call the files from the root directory, only place them in the root directory, and only have them in the root directory.

    this means that i really can't seem to get anything to work unless every file on my site is in the root directory.

    i saw somethign similar to what you did and tried it, but aparently i added the url in the wrong spot. thanks, ill try this one out.

  14. #14
    SitePoint Wizard geiger's Avatar
    Join Date
    Jul 2001
    Posts
    2,459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i FINALLY got it to work! thanks a lot. true help.

    aparently before i tried putting the full path in the SRC section, but it should have been in the CODE BASE. and now everything's working fine.

    thanks again!

  15. #15
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool.


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
  •