我有index.php和cpanel页面,它们通过jquery加载到索引主体中
detailArea.MyDataControl.Visibility = Visibility.Collapsed;
我不想使用长路径文件夹,我只需要设置哈希即可,
我想使用不带井号(#)的哈希
if (location.hash == '#cp') {
$(".body").load('cpanel/index.php');
};
我希望它像example.com/#cp
facebook.com/username
没有任何文件夹路径。
答案 0 :(得分:0)
您可以使用服务器端路由方法来处理URL。如果只想使用JS,则可以操纵location.pathname
之类的位置属性来操纵URL。