mailto using javascript

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 = "https://stackoverflow.com/questions/10172499/mailto:mail@example.org";
}
<body onload="javascript: redirect();">

Or just directly

<body onload="javascript: window.location.href="https://stackoverflow.com/questions/10172499/mailto:mail@example.org";">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)