如何在弹出窗口中加载网页

How to load webpage with in the popup

我的 wordpress 网站上有点击弹出窗口,其中包含 [woocommerce_order_tracking]
我想对跟踪按钮进行 ajax 化,这样用户就可以在同一个弹出窗口中跟踪他们的订单,而无需刷新页面。

如果您可以使用 jQuery,Ajax 内容并将其注入您的页面相对简单。您可以只使用 .get() or .load() depending on you you want to use the data. If you just want to inject it into your page, go for .load(). Read the documentation 来了解如何使用它,但下面是一个示例:

<div id="result"></div>
<script>
// This will load the contents of "path/to/file.html in the div #result
$( "#result" ).load( "path/to/file.html" );
</script>