I am trying to insert an email link using jquery, but if the email body has a & in it, it will not work.
$('#em_button').html('<a href="mailto:?subject=A Photo: ' + js_images[getImg].title + '&body=I thought you would like this photo: ' + thisPage + '?id=' + getGall + '&img=' + js_images[getImg].filename + '"><img src="' + homeUrl + '/' + tUrl + '/img/email.png" title="Email this photo" /></a>');
The part that is breaking it is &img=. I’ve tried using & but that didnt work either. Any suggestions?
Note: If there is no &, everything works fine.
You can try this, hope it works