In my jQuery Mobile App, I have a mailto link, its href attribute is dynamically generated and it is 'clicked' via jQuery.Here is the link code:
<a id="mealLink" href="mailto:123@123.com" style="display: none;">This is the mailto
link</a>
A click handler is attached to it like this:
$('#mailLink').bind('click', function() {
window.location.href = $(this).attr('href');
});
Lastly,a function creates the href attribute for the link with emailaddress, subject and message body and click is simulated via jQuery:
$emailAddress= ..
$subject= ....
$body=...
$emailString="mailto:"+$emailAddress+$subject+$body;
$emailLink= $("#mealMail");
$emailLink.attr("href",$emailString);
$emailLink.click();
Now, this code is working perfectly in: Mozilla desktop Safari desktop Android
But not working in: Safari Mobile Chrome desktop
Any suggestions?