post value to box page, control box page without refresh main page.

Discussion in 'Web Design and Development' started by youlichika, May 12, 2011.

  1. youlichika macrumors member

    Joined:
    Aug 27, 2010
    #1
    I want make a products show page.

    one is index.php, another is search.php (as a jquery box page). index.php have some products catagory lists, click each product catagory item will pass each value to search.php. search.php will make a mysql query and show products details and it also has a search box.(search.php can turn page show multi products, the search result looks like similar as a jqeury gallery...).

    I need do any thing in search.php but without refresh index.php.

    I find some site like my request. http://powerwall.msnbc.msn.com/. you can try in there. (in the main page, he has many pictures, but I replace into many word links). click each link, open a box page.(may be in this step he use statics page, but I use a mysql query, query out all this kind of products) Then make anything in box page, the main page without refresh. The next fuction, we both are similar. box page also have a search function. see his top bing search.

    I have no idea how to combine js, pass value, get value can reach this effection. So, is there anyone know how to do, and give me some simple code? many thanks.
     
  2. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #2

    Check out the jQuery "post" function. It sets up to post your form via ajax, then returns a result that you can place into the appropriate page element.

    http://api.jquery.com/jQuery.post/
     
  3. youlichika thread starter macrumors member

    Joined:
    Aug 27, 2010
    #3
    @bpaluzzi, I have tired jquery.ajax, jquery.json and even jquery.load(load search.php into index.php) but, if there have search or pagination in search.php. is it nessesary pass the search value and pagination value depend on url? if the url change, the two page will refresh at once.

    I notice msnbc use '#' to divide two pages url, so that change the search.php' s url, the index.php will not refresh.
     
  4. designguy79 macrumors 6502

    Joined:
    Sep 24, 2009
    Location:
    Michigan
    #4
    It sounds like maybe you haven't used any AJAX scripts before -- it all happens "behind the scenes." The main URL does stay the same if you can get all of pieces lined up properly.

    I would recommend reading up on some "AJAX jquery tutorial." I skimmed this one, but it looks pretty good:

    http://blogs.sitepoint.com/ajax-jquery/

    Hope that helps!

    ~ Jeremy
     
  5. youlichika thread starter macrumors member

    Joined:
    Aug 27, 2010
    #5

Share This Page