如何使用jquery从PHP重定向或加载新的PHP页面? [英] How to redirect or load new PHP page from PHP using jquery?
问题描述
我试图使用Jquery从PHP页面加载新的php页面。
检查我的浏览器JS也已启用。我尝试使用Mozila,IE和Chrome。
然后我在Dreamweaver中管理网站,我通过实时预览检查它,当我点击点击事件时,它加载正常。
但是在上面两种方法中没有3个浏览器。
我很遗憾缺少什么这里????
我的尝试:
< pre lang =Javascript> window 。 location = ' admin-editcp.php'; // 没有成功
$( location )。attr(' href',' admin-editcp.php'); // 没有成功
( location )。attr(' href',' admin-editcp.php'); // 没有成功
你的问题不够明确,不能正确回答;
你得到了什么?错误?或什么?
你什么时候开始行动?的onclick? onload of window?
forload试试以下
< script type =text / javascript>
window.location =newpage.html;
< / script>
你也可以使用window.onload;从浏览器到浏览器,这种特殊的功能表现不同。链接 GlobalEventHandlers.onload - Web API | MDN [ ^ ]
我有bootstrap导航栏,我的目标是在点击菜单时加载新的PHP页面。
所以我需要创建一个点击导航事件> ul> li> a ..我试过它
I was trying to load new php page from one the PHP page using Jquery.
Checked my browser JS is also enabled. I tried it with Mozila, IE and Chrome.
Then i manage site in dreamweaver and I checked it there via live preview and when i clicked in click event, it loads properly.
But not in the above two methods with 3 browser.
I am confuse that what is missing here????
What I have tried:
window.location = 'admin-editcp.php'; // no success
$(location).attr('href','admin-editcp.php'); // no success
(location).attr('href','admin-editcp.php'); // no success
Your question is not clear enough to answer properly;
What do you get? error? or what?
When do you expect the action? onclick? onload of window?
for onload try the following
<script type="text/javascript"> window.location = "newpage.html"; </script>
you can also use window.onload; from browser to browser this particular funtion behave differently. Link GlobalEventHandlers.onload - Web APIs | MDN[^]
I am having bootstrap nav bar and my objective is to load new PHP page when i click on menu.
So i need to create a click event for nav>ul>li>a.. I tried it as
这篇关于如何使用jquery从PHP重定向或加载新的PHP页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!