简体   繁体   English

在两个PHP文件或页面之间导航,而无需重新加载

[英]Navigate between two PHP files or pages without reloading

I have 2 PHP file one is index.php and other is gallery.php . 我有2个PHP文件,一个是index.php ,另一个是gallery.php

I would like users to be able to move between index.php and gallery.php (and vice versa) without reloading or redirecting the current PHP page. 我希望用户能够在index.phpgallery.php之间移动(反之亦然),而无需重新加载或重定向当前的PHP页面。

Link to my website: clickatcareerherokupapp.com 链接到我的网站:clickatcareerherokupapp.com

You can use jquery's .load() function, which I believe is part of the Ajax api. 您可以使用jquery的.load()函数,我相信它是Ajax api的一部分。 You can load php files into lets say a div, table, or whatever dom type you're working with.(assuming your only loading html content generated by php) In my opinion, this is easier than using the native ajax functions because you don't have to worry about return types,send types, etc. 您可以将php文件加载到一个div,表或您正在使用的任何dom类型中。(假设您仅加载php生成的html内容)在我看来,这比使用本机ajax函数要容易,不必担心返回类型,发送类型等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM