how to make page refresh like this?

Discussion in 'PHP' started by youlichika, May 12, 2011.

  1. #1
    Hello to all. I want make a products show page.

    one is index.php, another is search.php(as a jquery pop box page). index.php have some products list, click each one pass the value to search.php. search.php show products details and it also has a search box.(search.php can turn page show multi products, it looks like similar as a jqeury gallery...).

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

    I tried many method as I can. make search.php as an iframe(but can not judge search.php height when it turn page and index.php without refresh); use jquery json pass value from index.php to search.php, then get back all page's value to index.php. (still met some url rule trouble. php reley on url pass value, but if the value change, the two page will refresh at once. )

    so. I think, ask, find, try...
    I find a site like my request.

    http://powerwall.msnbc.msn.com/politics/search?searchTerm=usa
    (in this url, change search word after = the page will refresh)

    http://powerwall.msnbc.msn.com/#!wallState=0__/politics/search?searchTerm=usa
    (in this url, change search word after %3D, only the cover page refresh)

    I find somthing in its source code, I think it done becasue this js rules

    <script type="text/javascript"> 
    var fastReplace = function() {
        var href = document.location.href;
        var siteUrl = window.location.port ? window.location.protocol+'//'+window.location.hostname +':'+window.location.port : window.location.protocol+'//'+window.location.hostname;
        var delimiter = href.indexOf('#!') !== -1 ? '#!wallState=' : '#wallState=';
     
        var pieces = href.split(delimiter);
        if ( pieces[1] ) {
            var pieces2 = pieces[1].split('__');
            if ( pieces2[1] && pieces2[1].length > 1) {
                window.location.replace( unescape(pieces2[1].replace(/\+/g, " ")));
            }
        }
    }();
    </script> 
    HTML:
    I still not know how to make it.
    If in my condition. one page is index.php. another is search.php.
    How to use js make a search url like
    index.php#search.php?word=XXX&page=XXX
    then how to pass value from one to another avoid refresh index.php?

    Thanks to all.
     
    youlichika, May 12, 2011 IP