I have to load JQuery script dynamically beacause the script is sometimes charged and sometimes it doesn't. After that, I have to execute a JQuery function. I have tried but it doesn't work. Can you help me? This is my code:
<script>
var script = document.createElement("script");`
script.type = "text/javascript";
script.src = "http://code.jquery.com/jquery-1.7.1.min.js";
script.text = "alert('voila!');"
document.body.appendChild(script);
$(document).ready(function() {
getNumRecommendations("http://localhost:8080/elAbogado/","3974");});
</script>