, , .
, - . , .
;
var href = window.location.href;
href .
href = href.split("#/");
#
item = href[1].split("/");
, .
lastitem = item[item.length-1]
var. , , , .
, , - href -, , "", .
, , jquery ajax url. , , . php . jquery html ajax-url.
, , (/). php , .
$.ajax({
url: lastitem'.php',
success: function(data) {
$('.content').html(data);
}
});
Then the links will use jquery.click (). If there is a site called "about", the href link for that link may be <a href="#/about">About us</a>. This should then be added to the end of the URL in the address bar.
The click event may be like
$("a").click(function() {
var href = $(this).attr(href);
href = href.split(
href = href[href.length-1];
$.ajax({
url: href'.php',
success: function(data) {
$('.content').html(data);
}
});
});
This is just a simple idea that I am going to try.
source
share