Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    where you click it and it goes back a page... histroy(-1) or something
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  2. #12
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    I'll give it a go after Ive finished what im doing
    Hi, names James. I am a web developer.

  3. #13
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Protege View Post
    A back button, explain more
    Where you can click back, like somewhere on the page which takes you to your previous page.

    I got half of it working, when you click a link, it also saves the page name in a var, but if you go back to the first page, if you click back it goes to a blank page. I tired if(backpage = "home.php") it removes the back button, but didn't work :S


    Quote Originally Posted by Flisker View Post
    where you click it and it goes back a page... histroy(-1) or something
    That takes the full page back, not the ajax

  4. #14
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    I'll post it at 5-6 Tonight. So wait for then (maybe 4 depends when i get back) I'll do a back, forward, and refresh.
    Hi, names James. I am a web developer.

  5. #15
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Nice one

  6. #16
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Since this is an ajax thread i gonna kinda hijack your thread for a sec, on my thread in the coding community section i want something to fade. Using ajax i load the page then the page i load i want it to fade something on the main page if u get me? lol

  7. #17
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    I'm not accepted into the coding community, I feel so rejected! I'm still doing this back/forward/refresh thing. Afterwards - of course
    Hi, names James. I am a web developer.

  8. #18
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Alright, I've probably done this wrong but you can go as many page backs as you've gone forward (if that makes sense), I haven't coded in the forward feature as I have a massive headache

    Heres the testpage alt'd, also you can put some hover on the images for a cursor thats upto you.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    
    <head>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    
        <title>Test page</title>
    
        <script type="text/javascript">
            var div;
            var pagehistory = [ 0 ];
            var pagechr;
            var pagenum;
            var forward;
            var currentpage = '';
            
            function pasteControls ( div, location )
            {
                var loc = document.getElementById( location );
                loc.innerHTML = '<a onClick="doPage( 1, ' + div + ' );"><img src="action_back.gif" alt="Back" /></a><a onClick="doPage( 2, ' + div + ' );"><img src="action_refresh.gif" alt="Back" /></a>';
            }
            
            function doPage ( param, div )
            {
                if ( param == 1 )
                {
                    if ( forward == 1 )
                    {
                        forward = 0;
                        pagehistory.pop();
                    }
                    pagenum = pagehistory.length;
                    pagechr = pagehistory.pop();
                    if ( pagenum >= 0 )
                    {
                        loadPage ( pagechr, div, 2 );
                    }
                }
                else if ( param == 2 )
                {
                    if ( currentpage !== '' )
                    {
                        loadPage ( currentpage, div, 2 );
                    }            
                }
                else if ( param == 3 )
                {
                    /* Forward */
                }
            }
            
            function loadPage ( page, obj, option )
            {
                currentpage = page;
                if ( option == 0 )
                {
                    pagehistory[ pagehistory.length ] = page;
                    forward = 1;
                }
                
                div = document.getElementById( 'content' );            
                if ( window.XMLHttpRequest )
                {
                   httpRequest = new XMLHttpRequest();
                }
                else if ( window.ActiveXObject )
                {
                   httpRequest = new ActiveXObject ( 'Microsoft.XMLHTTP' );
                }
                httpRequest.open ( 'GET', page, true );
                httpRequest.onreadystatechange = processPage;
                httpRequest.send ( false );
            }
            
            function processPage ()
            {
                if ( httpRequest.readyState == 4 )
                {    
                    if ( httpRequest.status == 200 )
                    {
                        if ( httpRequest.responseText == '' )
                        {
                            div.innerHTML = 'Failed to load page';
                        }
                        else if ( httpRequest.responseText != '' )
                        {
                            div.innerHTML = httpRequest.responseText;
                        }
                    }
                }
            }
        </script>
    
    </head>
    
    <body onLoad="pasteControls ( 'content', 'content-ajax-controls' );">
    <div id="content-ajax-controls"></div><div id="errors"></div>
    <a href="javascript:loadPage( 'test_page.html', 'content', 0 )">Load</a>
    <a href="javascript:loadPage( 'differentpage.html', 'content', 0 )">Load</a>
    <div id="content"></div>
    
    </body>
    </html>
    Different test file -> http://www.interstudios.co.uk/freeSc...ader-objs.html
    Hi, names James. I am a web developer.

  9. #19
    Join Date
    May 2008
    Posts
    910
    Tokens
    0

    Default

    It's much better with the control buttons, can't wait for a forward button.

Page 2 of 2 FirstFirst 12

Posting Permissions

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