Answer the question
In order to leave comments, you need to log in
How to use a URL like VKontakte?
On VKontakte, all URLs look like this:
vk.com/feed
vk.com/im
And when you switch between them, the page does not reload completely, but only the necessary part. I only know that such a result can be achieved only if you use one page and generate content on it with scripts, but in this case the URL will look like site.ru?page=news, which is not very beautiful. So how is it still used on VKontakte?
Answer the question
In order to leave comments, you need to log in
You can always change the look of the url. You can also remove the extension (php, for example) or add it the other way around, no matter how you load the page.
"And when you switch between them, the page does not reload completely, but only the necessary part."
When switching between vk.com/feed and vk.com/im, it will be mandatory to reload, unless the browser does not reload the cache, i.e. if the url has changed in the navigation bar, but if only the anchor (#) has changed, then this is a completely different matter.
You can pull data to the right place using Ajax, for example, by attaching functions to certain links, actions, buttons.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question