Page refresh with limit

Asked

Viewed 60 times

0

Possible some form of a script that updates the page in a limited way ? example I have the script update a page only 10 times and then to is possible ?

  • 1

    What did you try, what was the difficulty? You need to give a little more detail, otherwise each reader can understand something different than what you want to do (and none of the things are what you seek). It would be more productive [Dit] the question and give an example contextualizing what you want, and type of update is talking. Here are some tips to better elaborate your question, if you don’t know where to start: [Ask], Scope of the site and [Help].

1 answer

3


Clarify a little more what you need, but yes it is possible an example in javascript:

    var vezes = 2;

    var  conta = window.location.href;
    conta = conta.split("conta=");

    if(conta.length > 1){
        var num = conta[1];

        redireciona(num);
    }else{
        redireciona(1);
    }

    function redireciona(num){
        if(num == 'NaN' || num == ''){
            num = 1;
        }
        if(num <= vezes){
            alert('redirecionamento '+num+ ' de '+vezes);
            window.location = "?conta="+(eval(num)+1);
        }

    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.