So habe ich die folgende JQuery Aufruf einer JavaScript-MethodeÄndern Javascript-Methode JQuery
$j("a.Pinterest").attr("href", "javascript:void(addScript());");
Und das ist die Javascript-Methode
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);
}
ich mich gefragt, ob es einen Weg, um alles zu haben in Jquery?
Werfen Sie einen Blick in die Dokumentation jQuery: http://api.jquery.com/jQuery.getScript/ –
hmm, jetzt einige Code schreiben, halten pls auf abit –
Dubletten: http://stackoverflow.com/questions/4881164/loading-a-external-script-nach-page-load-with-jquery, http://stackoverflow.com/questions/9441142/load-external-js-file-with-jquery, http://stackoverflow.com/questions/5624366/dynamically-load-external-js-and-write-response-to-a-div, http://stackoverflow.com/questions/4361033/jquery-load-script-on-click –