简体   繁体   中英

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

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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