I am attaching a screenshot of where I want to put the script below. If I open this in a browser, it works perfectly. The javascript is currently in an anchor tag with a custom link. All this does is create a vCard and download it. I want to download the vCard onclick of the “Download Contact” button.
Here is the code I want to put in the Landing Page:
<html>
<head>
</head>
<body onload=“loadvcard()”>
<script>
function loadvcard(){
var data = “BEGIN%3AVCARD%0AVERSION%3A3.0%0AN%3ABriggs%3BMatthew%0AFN%3AMatthew%20Briggs%0ATITLE%3AContent%20Manager%0AORG%3ASt.%20Charles%20Trading%3BMarketing%0AEMAIL%3BTYPE%3DWORK%2CINTERNET%3Ambriggs%40stcharlestrading.com%0ATEL%3BTYPE%3DWORK%2CVOICE%3A630-377-0608%0ATEL%3BTYPE%3DCELL%2CVOICE%3A217-415-8617%0AADR%3BTYPE%3DWORK%3A%3B%3B1400%20Madeline%20Lane%3BElgin%3BIllinois%3B60124%0AEND%3AVCARD”;
window.open(“data:text/x-vcard;urlencoded,” + data);
}
</script>
</body>
</html>
Javascript to fire onclick of Download Contact button
