[英]Using Ajax with Wordpress to load Div without reloading page
I would like to be able to use the links of the left side of this page to load the sections without reloading the page. 我希望能够使用此页面左侧的链接来加载部分,而无需重新加载页面。 I'm assuming using Ajax would work but do not know javascript well enough to implement it.
我假设使用Ajax可以正常工作,但是对JavaScript的了解不够深,无法实现它。
I tried using the Ajaxify your WP tutorial but it's not working with my links ( ajaxify tut ) 我尝试使用Ajaxify您的WP教程,但不适用于我的链接( ajaxify tut )
Is there a simple way to achieve with a minimal amount of coding? 有没有一种简单的方法可以用最少的编码来实现?
Thanks! 谢谢!
I used this tutorial ( ajax tutorial ) and it worked. 我使用了本教程( ajax教程 ),并且有效。 I overcomplicated it because it was wordpress and didn't think that method would work.
我把它复杂化了,因为它是wordpress的,并且认为该方法不起作用。
I added the javascript to the footer.php file. 我将javascript添加到footer.php文件。 You can see the result here: example
您可以在此处查看结果: 示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.