How to add an update block in history?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
25 views
There is code:

$("#top_menu a").click(function(e) { e.preventDefault(); var href = $(this).attr("href"); $("#content").load(href, function() {}); });


It updates the block and adds the content by clicking on the link, without reloading the other elements:

MainBlog




In General, the problem is this: due to my stupidity and inability to Google (although Google pretty much), I don't understand how to add to the story if you click on these same links, ie need to update the unit to add to the story.
Maybe not quite properly explained, but I think you get the idea (I'm new to sajtostroenija).
Any ideas?

Thank you in advance.
by | 25 views

2 Answers

0 like 0 dislike
Perhaps you mean this history.pushState(state, title, url);
by
0 like 0 dislike
possible solution - carlofontanos.com/using-history-js-with-ajax . I think it only correct to suit your needs and in addition to the pushState to use .log(state) and another event handler for the statechange
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
3 answers
0 like 0 dislike
6 answers
110,608 questions
257,186 answers
0 comments
36,634 users