How can I launch the eMail client, and then do a page redirect with Javascript?

前端 未结 4 629
误落风尘
误落风尘 2021-01-14 15:04

I\'m required to make a website function exactly the same on other browsers as it does in IE6. Part of the current code looks similar to this:



        
4条回答
  •  盖世英雄少女心
    2021-01-14 15:32

    On the whole, I tend to think security settings will get in your way and would recommend just giving the user a boring old-fashioned mailto link to click. (Edit: Perhaps one set up like Mic suggests.)

    That said, I wonder if things become any more reliable if you introduce a delay:

    function myFunc() {
        location.href = "mailto:test@test.com&body=Hello!";
        setTimeout(function() {
            location.href = "newPage.html";
        }, 500);
    }
    

提交回复
热议问题