Answer the question
In order to leave comments, you need to log in
How to submit a page via ajax?
The bottom line is that I load the page using AJAX (for example, info.php), after loading, you need to change the title of the browser tab and load inf.js.
As I understand it, I need to send a json array using php:
{
title : 'Info',
src : 'inf.js'
page : here is the whole info.php page
}
Answer the question
In order to leave comments, you need to log in
If you need to make a site where there is no transition between pages, but all of them are loaded via AJAX - try using libraries for building SPA sites like AngularJS .
If you want to do it manually, then at least transfer not the entire page, but only the part that changes - the content. And do not forget that even in the answer it is worth considering the possibility of errors.
That is, it might look like this:
// Грубый пример
{
"status": "ok",
"data": {
// Ваши данные
},
"errors": []
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question