gpt4 book ai didi

jquery - 切换 php 包含 jQuery

转载 作者:行者123 更新时间:2023-12-01 06:59:03 24 4
gpt4 key购买 nike

在我的 php 页面上,我有两个代码,我一次使用一个:

include_once "page1.inc.php";

include_once "page2.inc.php";

我可以在单击时将它们包含在 jQuery 中,还是需要将它们都包含在内,隐藏其中一个,然后使用切换?

最佳答案

您可以使用load根据需要加载它们:

.load() sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:

$('#result').load('ajax/test.html');

因此,当您第一次想要打开其中一个时,可以使用 load 来获取数据。您可以使用one绑定(bind)AJAX加载这样它只会被调用一次。

关于jquery - 切换 php 包含 jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5759910/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com