Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File path/href dynamic discovery

    Can anyone advice how I can use javascript to output the location of the file it is currently executing on and output locations of other files aswell?

    My attempt to use ajax to load up files from a folder called private is yielding no results. With this line of code:

    request.open("GET", "/private/new_index_ajax.php?login="+userID, true);

    The request object is fine, it just doesn't seem to like the directory path. The originating php file is in the same directory as the private directory so there shouldn't be any need to navigate away?

    So, I want to find out where javascript "thinks" it is. Perhaps it's looking in the wrong place(s)?

    I hope this make sence. Please help me.

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    To answer your question...i am going to ask you a question.

    Can you access the page you are calling via JS with your browser?

    Code:
    http://your_domain.com/private/new_index_ajax.php?login=userID
    In other words, if you cannot access the page via your browser...then JS won't access it either.

    Good luck.
    Ess

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I see your point but the page I am trying to load via javascript does load by itself in IE and FireFox.



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •