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

196
Views
Issue with window.replace() method having search params in URL

I m trying to open a new window from my web page while clicking on the 'number#' lsted in my page, actually, it's a google search(eg: https://www.google.com/search?q=12312), and got the results in the new tab

I am also trying to replace the search query parameter again while clicking on another Number#(eg: https://www.google.com/search?q=456456), But replace functionality not working. Below I am placed the demo code

let win;
let firstSearch = () => {
    win = window.open('https://www.google.com/search?q=123123', '_blank');
}

let secondSearch = () => {
    win.location.replace('https://www.google.com/search?q=345345')
}

But its not working. But I remove '/search' from the URL replacement is happen. So, any solution for this search and replacement parameters

Codepen

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

0

That is not working because the site tells the browser that they don't want to be loaded in X-Frame. That's why your code works using Bing but not Google...

from: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. Sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites.

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!