So I have the following Jquery calling a Javascript method
$j("a.Pinterest").attr("href", "javascript:void(addScript());");
And this is the Javascript Method
function addScript() {
var e = document.createElement('script');
e.setAttribute('type', 'text/javascript');
e.setAttribute('charset', 'UTF-8');
e.setAttribute('src', 'http://assets.pinterest.com/js/pinmarklet.js?r=' + Math.random() * 99999999);
return document.body.appendChild(e);
}
I was wondering if there was a way to have it all in Jquery ?