繁体   English   中英

JS / jQuery mailto并加载其他网站

[英]JS/jQuery mailto AND loading other site

我的情况如下:我有以下站点: 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);

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM