Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
Append an url parameters every time page reload

I try to append a parameters to prevent hard caching every time page reload. This in Js or jQuery. The url page is always the same, but there's some submit button to proceed in the checkout(address -> shipping-> payment).

I want to know if there's a script that can be use in this way:

window.onload {
var thisurl = window.location;
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
var result = ""
var charactersLength = characters.length;

for ( var i = 0; i < 15 ; i++ ) {
    result += characters.charAt(Math.floor(Math.random() * charactersLength));
}

 window.location.replace(thisurl + "?prevent="+ result);
}

I want that every time user click on .continue button on checkout and the page will be load and process go ahead but remain same page that i want that change parameters.

How can I do it?

Thanks from Enrico.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Using jQuery this should work.

$('.continue').click(function() {
    var thisurl = window.location;
    var random = (Math.random() + 1).toString(36).substring(7);
    window.location.replace(thisurl + "?prevent="+ random);
    alert(thisurl + "?prevent="+ random);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button class="continue">continue</button>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!