简体   繁体   English

JS / jQuery mailto并加载其他网站

[英]JS/jQuery mailto AND loading other site

My situation is as follow: I have the sites: preview.html and index.html Now I have some inputs and a button on preview.html , which should open the email programm using mailto and load index.html where preview.html was displayed 我的情况如下:我有以下站点: preview.htmlindex.html现在,我有一些输入,并且在preview.html上有一个按钮,它应该使用mailto打开电子邮件程序并加载index.html ,其中显示了preview.html

I have tried 我努力了

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

Does anyone know how I could solve it? 有谁知道我该怎么解决?

The closest you can get client side - if the browser allows you is 您可以得到的最接近客户端的信息-如果浏览器允许,

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

or using an iFrame: 或使用iFrame:

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

but a better solution is to mail at the server and redirect 但是更好的解决方案是在服务器上发送邮件并重定向

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

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