Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
153
rated 0 times [  155] [ 2]  / answers: 1 / hits: 64378  / 8 Years ago, wed, june 29, 2016, 12:00:00

This is the ajax





$(.urut).change(function() {
$.ajax({
url: <?php echo base_url(); ?>categories/brand/<?= $link_brand; ?>?l=<?= $l; ?>&h=<?= $h; ?>&city=<?= $city; ?>&city_name=<?= $city_name; ?>&ket=view,
type: POST,
data: urut= + $(.urut).val(),
success: function(data) {
$(#result).html(data);
}
})
})





This works, but i want the url to change because I have many parameters there and of course with the data: urut=+$(.urut).val(), parameter as well.


More From » php

 Answers
113

You can do this to your success action :



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


See this post to Modify the URL without reloading the page for a basic how-to.




Additional Note:




  1. The first parameter is the data we'll need if the state of the web
    page changes, for instance whenever someone presses the back or
    forwards button in their browser. Note that in Firefox this data is
    limited to 640k characters.

  2. title is the second parameter which can be a string, but at the time
    of writing, every browser simply ignores it.

  3. This final parameter is the URL we want to appear in the address
    bar.




It's now available in most modern browsers.


[#61587] Monday, June 27, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
roberts

Total Points: 212
Total Questions: 101
Total Answers: 101

Location: Philippines
Member since Thu, Apr 14, 2022
2 Years ago
roberts questions
Sun, Feb 14, 21, 00:00, 3 Years ago
Tue, Dec 8, 20, 00:00, 4 Years ago
Wed, Jul 15, 20, 00:00, 4 Years ago
Wed, May 27, 20, 00:00, 4 Years ago
Mon, Apr 20, 20, 00:00, 4 Years ago
;