Php 如何使用jquery/ajax在函数加载时更改url
在搜索中没有找到任何帮助 我将做一些事情,比如将外部php文件的内容加载到index.php上的div容器中; 为此,我在超链接的href中添加了一个javascript调用,调用如下函数:Php 如何使用jquery/ajax在函数加载时更改url,php,javascript,jquery,hashtag,Php,Javascript,Jquery,Hashtag,在搜索中没有找到任何帮助 我将做一些事情,比如将外部php文件的内容加载到index.php上的div容器中; 为此,我在超链接的href中添加了一个javascript调用,调用如下函数: function contentloader(e){ switch(e){ case "profil": $("#content").load("profil.php"); this.href('#profil'); break; case "ein
function contentloader(e){
switch(e){
case "profil":
$("#content").load("profil.php");
this.href('#profil');
break;
case "einstellungen":
$("#content").load("einstellungen.php");
break;
case "freunde":
$("#content").load("freunde.php");
break;
}
}
实际上这很好,但现在我正在寻找一种可能性,在加载这样一个内容php文件后更改index.php的url。。。
例如,它应该是可能的,以安全的书签
index.phpprofile
index.phpeinstellungen
有没有人给我一个提示,让我去搜索或做类似的事情???
谢谢你的帮助
此外,这些外部php文件将包括复杂的php代码、mysql请求等…查看window.location.href.hash。您应该能够使用它来设置URL上的哈希值。查看并感谢您的帮助!我尝试了以下方法:函数contentloadere{switche{case profil:$content.loadprofil.php;var Ziel=!profil;window.location.hash=Ziel;break;}}}但是有一件事我自己没有得到答案——比如直接索引index.php!profil它正在打开index.php,但没有加载profil.php的外部内容-这是如何实现的,请耐心等待,我对编程和类似的东西还不熟悉:D提前感谢!