How can we change the page URL without refreshing the page?

0 votes

How do I change the URL without refreshing the page?

I've built a website with CodeIginer and I want to implement AJAX and JQuery in one of my pages. The problem is; when I load the content, the URL doesn't change.

Let's say that I have the URL https://www.edureka.co/controller/function/param
And another URL : https://www.edureka.co/controller/function/param2

How can I change the first URL to the second one when I click a button?

Apr 27 in Java-Script by kartik
• 11,890 points
27 views

1 answer to this question.

0 votes

Hello @kartik,

 In HTML5 you can change the URL:

window.history.pushState("object or string", "Title", "/new-url");

Thank You!!

answered Apr 27 by Niroj
• 23,950 points

Related Questions In Java-Script

0 votes
1 answer

How to implement useEffect() so the list on the front page updates only when a name change has been detected?

Hello @kartik, Instead of passing the entire object ...READ MORE

answered 5 days ago in Java-Script by Niroj
• 23,950 points
18 views
+1 vote
1 answer

How can we send message multiple time to a specific person or group in whatsapp using loop?

Hii @kartik,  This is simple task to send single ...READ MORE

answered Feb 28 in Java-Script by Niroj
• 23,950 points
250 views
0 votes
1 answer

How to Scroll to the top of the page using JavaScript?

Hii @kartik, Using javascript <script> $("a[href='#top']").click(function() { ...READ MORE

answered Apr 2 in Java-Script by Niroj
• 23,950 points
15 views
0 votes
1 answer

How can we parse JSON using Node.js?

Hello @kartik, You can simply use JSON.parse. The definition of ...READ MORE

answered Apr 24 in Java-Script by Niroj
• 23,950 points
41 views
0 votes
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 23,950 points
478 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18 in Laravel by Niroj
• 23,950 points
64 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23 in Laravel by Niroj
• 23,950 points
68 views
0 votes
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23 in Laravel by Niroj
• 23,950 points
174 views
0 votes
1 answer

How to change url after success in ajax without page reload?

Hello @kartik, Use the browser history to change ...READ MORE

answered Apr 29 in Java-Script by Niroj
• 23,950 points
70 views
0 votes
1 answer

How can we detect timeout on an AJAX (XmlHttpRequest) call in the browser?

Hii, In order to handle a timeout: var xmlHttp ...READ MORE

answered Apr 27 in Java-Script by Niroj
• 23,950 points
51 views