我正在使用jQuery插件使用"标签(通过ajax内容)."
I am using " tabs(content via ajax) using jQuery plugin."
当我单击选项卡时,将根据给定的URL将选定页面加载到其内容内.
When I click on the tab, according to the URL given selected page loads inside its content.
我想要的是: 我想在同一标签下显示另一个页面,然后删除当前页面的内容.
What I want is: I want to display another page under that same tab and remove the content of current page.
简而言之,如何在不刷新或重定向包含标签结构的主页的情况下,从标签下的已加载内容页面重定向到另一个页面?
In short, how can I redirect from loaded content page under tab to another page without refreshing or redirecting the main page which holds the tab structure?
推荐答案让我们说这是您的div:
Let's say this is your div:
<div id="content"> </div>发送ajax
在将获得ajax请求的页面中,您可以
In the page that will get your ajax request you can do
if(isset($_POST['getContent')){ $_POST['getContent'] = file_get_contents('getContent.php'); echo $_POST['getContent']; } $.ajax({ type:'POST', URL : 'page that will give you your reposne', data : { getContent : 'getContent' }, success:function(data){ if(data){ $('#content').html(data); } } });file_get_contents('getContent.php')以字符串形式返回文件的内容,因此,如果它是有效文件,则应该没有问题.
The file_get_contents('getContent.php') returns the content of the file in a string, so if it is a valid file you should have no problems.
更多推荐
在选项卡下动态加载页面
发布评论