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
    Aug 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to cal a php page within jquery but no data returned

    hi ,
    this is my code. i want to return data using a php page after processing a query within it.

    $.post('check_booked.php', { room:roomv, srtdate:sdatev, eddate:sdatev},
    function(data){
    alert( data);
    });
    before completing php page i test using online code which returned nothing.. i don't know what wrong,
    as i have understood anything within that php page eg: html code should be returned by this code. this is the test code i used and which didn't return anything.

    $.post("check_booked.php", function(data) {
    alert("Data Loaded: " + data);
    });
    and i have
    <h1>hi</h1>
    in my php page

    Please help me solve this. much appreciate help..!

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,247
    Thanks
    12
    Thanked 340 Times in 336 Posts
    well, if the PHP code isn’t working, you can’t expect the AJAX to return something.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    Regular Coder
    Join Date
    Jan 2008
    Location
    Geneva, Switzerland
    Posts
    413
    Thanks
    12
    Thanked 29 Times in 29 Posts
    Post your PHP code as well.

    Hint: do you "ECHO" something on the PHP side (as you should do) or did you try to "RETURN" something?
    Chuck Norris counted to infinity.
    Twice.


  •  

    Tags for this Thread

    Posting Permissions

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