我想知道,我怎样才能以html格式嵌入像myurl.php这样的http请求网址,然后使用按钮将值推送到服务器上 所以我想放(url.php),但我不希望页面重定向到url 每次我按提交。我只是希望数据到达指定的服务器。 不,我不拥有相关网站。
答案 0 :(得分:0)
您可以通过ajax使用此示例代码
来执行此操作$("formId").submit(function(e){
e.preventDefault();
$.ajax({
type: "POST",
url: 'url.php',
data: $("#formId").serialize(), // serializes the form's elements.
success: function(data)
{
alert(data); // show response from the php script.
}
})
});
或者您可以使用Ajax Form plugin