View Single Post
Old 11-01-2012, 01:32 AM   PM User | #22
markman641
Regular Coder

 
Join Date: Jul 2011
Posts: 246
Thanks: 58
Thanked 1 Time in 1 Post
markman641 has a little shameless behaviour in the past
Quote:
Originally Posted by Old Pedant View Post
Well, you have zero code in there doing that, so far as I can see. So I haven't the foggiest idea why it works in Chrome.

You could, however, easily fix the code:
Code:
    function loadNextPage(dir) {   
        cnt += dir;
        // this can never happen: if (cnt<0) cnt=webpageArray.length-1; // wrap
        
        if (cnt>= webpageArray.length) {
            return true;
        } 
        var iframe = document.getElementById("myframe"); 
        iframe.src = webpageArray[cnt]; 
        countDown = 10;
        doCountDown( );
        $('html, body').animate({ scrollTop: 0 }, 'fast');
        return false;
    }
And then:
Code:
<input type="submit" name="submit4" value="Submit" onclick="return loadNextPage(1);">
Unfortunately firefox is still refreshing the page. Works in chrome still though.
markman641 is offline   Reply With Quote