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 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    define path directory in Ajax

    H!... appreciate that someone can help on Ajax.

    I have problem on define the url (filename) to send to the server which my file 'getcustomer.asp' locate at root directory which my form is locate in the sub directory...would like to know how to define the code as i have define

    var url="getcustomer.asp"; // in javascript

    but it prompt out ('null' is null or not an object) and it cannot pass my parameter to this file 'getcustomer.asp'.

    Thank You.....

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    To go up one:
    Code:
    var url="../getcustomer.asp";

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have try to use the above code but it prompt me the error:-
    'null' is null or not an object.

    is there anywhere can help.

    Thank You

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    The relative url '../getcustomer.asp' should be right if the script is running from a directory that is located in the root directory.
    You could use the full URL to see if you get the same error
    Code:
    var url=location.host+"getcustomer.asp";
    Are you sure the error is from the file path? Are you checking the response?
    The error 'null' is null or not an object is not an expected response.
    Are you using 'null' as a variable or value?
    Last edited by rwedge; 08-07-2007 at 10:01 AM.

  • #5
    New Coder
    Join Date
    Jun 2007
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Or you could use the absolute location:
    Code:
    var url="/getcustomer.asp"

  • #6
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    As rwedge already said, I think you have a different problem.

    Can you show us the exact code that is giving you the error. If you run this under Firefox with the Firebug extension, does it give you a better error location.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #7
    New Coder
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry 'rwedge' i have check the error was due to my database location. Yes, you are rite we use

    var url="../getcustomer.asp";
    or
    var url="getcustomer.asp";

    many thanks to you all ........


  •  

    Posting Permissions

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