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

128
Views
JS window.location issue

I use this code for a redirection form when selecting a different jersey from the select input but while the JSfiddle works at my site there is no redirection from the window.location command.

https://jsfiddle.net/giorgoskey/95k1tc0b/4/

function populateSecondTextBox() {
  var p = document.getElementById('your_name');
  var txt = document.getElementById('txtFirst');
  p.textContent = txt.value;
}

function populateNumberTextBox() {
  var p = document.getElementById('your_number');
  var txt = document.getElementById('txtSecond');
  p.textContent = txt.value;
}

var goBtn = document.getElementById("goBtn");
var shirts = document.getElementById("shirts");

goBtn.onclick = function() {
  window.location = shirts.value;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hou have to use history.pusthState()

MDM

history.pushState(state, title [, url])

empty state and title.

window.history.pushState({}, '', url);

in your case


var goBtn = document.getElementById("goBtn");
var shirts = document.getElementById("shirts");

goBtn.onclick = function() {
    window.history.pushState({}, '', shirts.value);
}
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!