JS/jQuery mailto AND加载其他站点

JS/jQuery mailto AND loading other site

本文关键字:加载 其他 站点 AND mailto jQuery JS      更新时间:2023-09-26

我的情况如下:我有以下网站:preview.htmlindex.html现在我在preview.html上有一些输入和一个按钮,它应该使用mailto打开电子邮件程序,并加载index.html,其中preview.html显示

我试过

window.location.href = "mailto:[myadress]?subject=[formname]&body[his inputs]";
window.location = "index.html"

有人知道我该怎么解决吗?

如果浏览器允许,最接近客户端的是

window.open("mailto:[myadress]?subject=[formname]&body[his inputs]","_blank");
window.location = "index.html"

或使用iFrame:

window.iFramename.location="mailto:[myadress]?subject=[formname]&body[his inputs]";
setTimeout(function() {
  window.location = "index.html";
}),1000);

但更好的解决方案是在服务器上发送邮件并重定向