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

94
Views
Run another script after reloading the page with jquery

I have a requirement which needs to load after reloading the page with Jquery. Below is the code.

$("a[id='gobutton']").click(function(e)) { 
  location.reload();
  somefunc(); 
});
function somefunc() { 
  alert("run my script"); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

After you run location.reload() your code is gone. You cant run anything after it. You would need to pass an argument to the page to run the function.

let param = new URLSearchParams(location.search);
$("a[id='gobutton']").click(function(e)) { 
  location.href = '?somefunc=true' 
});

if(param.get('somefunc'){
  somefunc()
}
function somefunc(){}

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!