mailto using javascript

后端 未结 6 1638
轮回少年
轮回少年 2020-11-30 03:23

I want to open a new outlook mail template with the \'To address\' whenever a user clicks an image. I have return my code in a html page(linked with the image), whenever it

6条回答
  •  忘掉有多难
    2020-11-30 04:05

    No need for jQuery. And it isn't necessary to open a new window. Protocols which doesn't return HTTP data to the browser (mailto:, irc://, magnet:, ftp:// (<- it depends how it is implemented, normally the browser has an FTP client built in)) can be queried in the same window without losing the current content. In your case:

    function redirect()
    {
        window.location.href = "mailto:mail@example.org";
    }
    
    

    Or just directly

    
    

提交回复
热议问题