There is a one-page project, everything is loaded via ajax. How to make the address was
http://mysite.com/'нужная страница'
So that index.php is always loading and, based on the end of the address, the ajax page is built?
There is a one-page project, everything is loaded via ajax. How to make the address was
http://mysite.com/'нужная страница'
So that index.php is always loading and, based on the end of the address, the ajax page is built?
Perhaps it would be better to use the HTML 5 History API. Follow this link , there after the manual in English there will be a manual in Russian, as well as a demo from the author , where you can download the source of the site.
PS When I understood, this manual helped me a lot with this case. Good luck;)
Dig in the direction of history Hash .
In VC so:
var setLoc = function (loc) { //curLoc = fixEncode(loc.replace(/#(\/|!)?/, '')); curLoc = fixEncode(loc); var l = (location.toString().match(/#(.*)/) || {})[1] || ''; if (!l && vk.al > 1) { l = (location.pathname || '') + (location.search || ''); } l = fixEncode(l); if (l.replace(/^(\/|!)/, '') != curLoc) { if (vk.al == 3) { try { history.pushState({}, '', '/' + curLoc); return; } catch (e) {} } window.chHashFlag = true; location.hash = '#' + vk.navPrefix + curLoc; if (withFrame && getLoc() != curLoc) { setFrameContent(curLoc); } } }
Source: https://ru.stackoverflow.com/questions/163330/
All Articles