Window.location.href = mailto is not working in Google Chrome (Version 35.0.1916.153 m)
Asked Answered
A

0

6

I have run into a problem, and I cannot find any work around. I have a javascript function triggered by a onClientClick. It is working in Firefox and IE9, but not in chrome.

function PopUpMailRevision() {
        var email = document.getElementById("<%=hlEmail.ClientID%>").innerHTML;
        var travelRequestID = document.getElementById("<%=lblRequestID.ClientID%>").innerHTML;
        var travelRequestRev = document.getElementById("<%=lblRequestRevision.ClientID%>").innerHTML;
        var body = 'Below you will find the reason(s) for which your Travel Request was returned for revision.'
        var subject = 'Travel Request ' + travelRequestID + ' Version #' + travelRequestRev + ' returned for revision.';

        location.href = "mailto:" + encodeURIComponent(email) + '?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(body);

    }

Basicly all I need is to have the default email client to PopUp when a specific button is clicked.Like I said, this is working in IE and Firefox but not in chrome. Weird thing is that clicking a mailto hyperlink in chrome will make the default email client to open. Anyone has a workaround for this??

Thank you.

Ascot answered 11/7, 2014 at 15:44 Comment(1)
It is also not working in Safari.Ascot

© 2022 - 2024 — McMap. All rights reserved.