Results 1 to 2 of 2

Thread: $.ajax with jquery isn't working on my site

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default $.ajax with jquery isn't working on my site

    I'm trying to create a "scrolling pagination" (similar to Facebook) except users have to click to load more content.

    This is my javascript function. I'm using Jquery.

    Code:
    function GetMore(){
    $.ajax({
    url: 'phpfile_that_echos_content.php',
    success: function(data){
    $('#content').append(data);
    }
    });
    }
    The php file gets queries from the database and formats the information based on what type of content it is. The php file works without the ajax call.

    I call it using a clickable image...
    Code:
    <a href="javascript: GetMore()">
    <img src="image.png" />
    </a>
    However, when I click the image, it does not show. When I append data to the content div without using $.ajax, it works. My site is hosted on Godaddy with a Linux server and I'm using PHP. Does anyone know why my code isn't working?
    Last edited by jscheuer1; 07-30-2012 at 08:01 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are virtually an infinite number of possibilities as to why this might not work. To have the best chance of figuring it out, we need a link to the page.

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •