Yesideez Posted June 26, 2007 Share Posted June 26, 2007 Hi, I've got this small JS script: function doemail($name,$domain) { window.location='mailto:'.$name.'@'.$domain; return false; } In my HTML I've got this: <a href="javascript:doemail('someone','hotmail.co.uk')">My NAme</a> What I'm trying to do is make the link just like I've used "mailto:" in the href but it doesn't work. Any idea what's wrong with it please? Link to comment https://forums.phpfreaks.com/topic/57194-solved-hiding-email-address-within-html-using-js/ Share on other sites More sharing options...
Yesideez Posted June 26, 2007 Author Share Posted June 26, 2007 Fixed it with this instead: <script type="text/javascript">emailE=('some' + 'one' + '@' + 'hotmail' + '.co.uk');document.write('<a href="mailto:' + emailE + '">I Oliver</a>');</script> Link to comment https://forums.phpfreaks.com/topic/57194-solved-hiding-email-address-within-html-using-js/#findComment-282651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.