我想将 GET 值发送到另一个脚本,以便脚本获取这些 GET 值并根据它创建 PDF 并发送到用户电子邮件。我只需要如何使用 JavaScript 在 URL 中发送 GET 值而不重定向到您发送 GET 值所用的 URL。
如果有人可以在这里使用 JavaScript 或 jQuery 帮助我。这将是一个很大的帮助。
这是按钮。这不是一种形式。
<a href="javascript:" id="wpe_btnOrder" class="btn btn-wide btn-primary" data-tldinit="true"><span class="fa fa-check" data-tldinit="true"></span>SEND ME THE PDF<canvas class="lfb_shineCanvas" data-tldinit="true" width="202" height="41" style="border-radius: 4px;"></canvas></a>
这就是我想要发送值的方式:
最佳答案
试试这个:
$.ajax({
url: "your url",
type: "get", //send it through get method
data: {
name: "put the name value here",
},
success: function(response) {
//Do Something
},
error: function(xhr) {
//Do Something to handle error
}
});
关于javascript - 如何在不将用户重定向到该 URL 页面的情况下发送 GET 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53406434/