Well I stop using the two libraries and so that there was no conflict I opted to use jQuery.noConflict()
however at the same time I tried to keep using the dollar but my code breaks due to " asynchrony "of the code.
<script type='text/javascript' src='//code.jquery.com/jquery-2.1.3.js'></script>
<script>jQuery.noConflict();</script>
<script type='text/javascript' src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script><scripttype='text/javascript'>(function($){$("body").css('background-color', 'red');
var x = 1;
})(jQuery);
console.log(x);
</script>
Notice that X is not printed, how can I solve it?