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

206
Views
How to change URL without load in JavaScript

I have a question How to change URL without load. I am working on a PHP, JavaScript project. I am try to make without load Home page. in home Header section content some buttons like :-

Header Button

Header

on click button than load data using XMLHttpRequest() and i want to change Url like:-

https://example.com/home to https://example.com/search

Code

var xmld = new XMLHttpRequest();
    xmld.open("GET", "/Api/SearchPage", true);
    xmld.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmld.onreadystatechange = function() {
        if (xmld.readyState == 4 && xmld.status == 200) {
            var json = JSON.parse(xmld.responseText);
            if (json.Status == "Ok") {
                doument.querySelector("#content").innerHTML = json.HTMLData;
                window.location.href = "https://exmaple.com/Search"; // without load
            }
        }
    }
    xmld.send();

in example, when you click item than url change without load

I am not use any js and php framework

Example

https://dribbble.com/

https://in.pinterest.com/

it's possible??

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

0

if you don't use a framework window.history.pushState() will do the thing you want. See this link: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

about 4 years ago · Juan Pablo Isaza Report

0

Use a state manager like Redux with a modern Javascript framework like ReactJs.

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!