SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Evangelist runeveryday's Avatar
    Join Date
    Jul 2009
    Posts
    437
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    how to update the page content without refresh the page by jquery

    the page url is
    Code:
     `http://example.com/index.php?main_page=index&Path=<?php echo $_GET['Path'];?>`
    there are some contents on the page:
    Code:
        <div><a href="http://example.com/index.php?main_page=index&Path=<?php echo $_GET['Path'];?>&sort=1a">price </a></div>
                <div> the content....</div>
    if i click the price, the content will be arranged according to the price with ascending.

    Code:
     <div><a href="http://example.com/index.php?main_page=index&Path=<?php echo $_GET['Path'];?>&sort=1d">price </a></div>
                <div> the content....</div>
    if i click the price, the content will be arranged according to the price with descending.

    now, i want to get when the visitor click the `price` text, the content arranged can be exchanged. the default state is ascending. and don't refresh the page.

    how should i do?

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    user another script to load the content. then you can use the javascript load method to call as you need. for ordering need you can pass a query string.


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
  •