Results 1 to 2 of 2

Thread: AJAX using JQUERY

  1. #1
    wotupduck is offline New Member: Posts Will Be Moderated
    Join Date
    Mar 2011
    Posts
    1

    AJAX using JQUERY

    I am currently building a room booking web application for a school (as a school project) i currently have a index page with a div as follows:
    HTML Code:
    <div id="page_content">
    
    </div>
    this area of the page is used to load in external php pages with generate contnent for a database i am currently using jquery to load the content in:
    Code:
    $('#Rooms').click(function(){
    		$('#page_content').load('rooms.php');
    	});
    within the rooms.php file there is a jquery datepicker the problem i am having is making the datepicker work once it is loaded into the page content area of the index page. i have tryed including
    Code:
    <script>
    	$(function() {
    		$( "#datepicker" ).datepicker();
    	});
    	</script>
    as well as the required jquery ui scirpts that need importing in the rooms.php and index.php files aswell as putting the above code in the $(document).ready wrapper but i have had no luck making it work can anyone help? thanks in advance.

  2. #2
    Join Date
    Mar 2010
    Location
    Ithaca, NY, USA
    Posts
    212
    You need to specify an AJAX call with jQuery in order to retrieve content.

    Code:
    $.ajax({
      type: "GET",
      async: true,
      url: "whatever.php",
      success: function (data) {
        //Do what you will with the output stored in 'data'
      }
    });
    There is a ton more functionality for this, but this is the basic syntax for an AJAX call with jQuery.

Similar Threads

  1. AJAX, JQuery, JSON with api help needed please.
    By prionkor in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 21 Dec 2010, 07:43 AM
  2. jquery and ajax problem
    By maximus8888 in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 15 Apr 2010, 01:12 AM
  3. JQuery Slider + jQuery Popup = Problems
    By zibizibi in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 08 Aug 2009, 08:56 AM

Posting Permissions

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