E
E
Ermek Bektasov2017-11-05 01:11:59
JavaScript
Ermek Bektasov, 2017-11-05 01:11:59

Ajax + iframe page navigation?

Hello. Recently I asked how to navigate through pages without reloading like on https://spaces.ru . So I took their JS and put it on my site. Now, when clicking on links, it doesn’t go anywhere, opening the console, I saw a 404 error and a link of this kind -> mysite.ru/mail/ in the console displayed like this -> mysite.ru/xhr'randomNumbers'/mail/ . And if you view the code through chrome, then when you click on the link at the end of the document, it adds < iframe src= http://mysite.ru/xhr'randomNumbers'/mail/ .> Here, it seems, should be the content of the page on which I clicked the iframe. >. Maybe there is someone who knows how it all works and what I need to do to make it open links. Here is the link to JS -> https://spac.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Kit, 2017-11-05
@ShadowOfCasper

I don't understand why at all. For some reason, you decided that if you saw some kind of technology on the site, and even more so such an easy self-written one, then you can simply copy their code to your site and it will work for you as well. ROFL
Write your own ajax, if you want to do it through the creation of an iframe, snatching the address from the links to the necessary pages

A
Alexander Taratin, 2017-11-05
@Taraflex

Simple examples
javascript.ru/blog/pharrell/ajax-history-api
https://astrio.ru/blog/History-API/
cannot be called ideal, but it is more or less detailed.
In general, google - html5 history api ajax example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question