I load some HTML code into a div with the $.ajax function. but the script that I have in <body> doesn't execute, can you help me please, it's very important for me.
This is my HTML main page:
<!DOCTYPE html>
<html>
<head>
<title>Navigation AJAX avec jQuery</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var $contenu_div = $('#content div');
$('#nav li a').on('click', function() {
var url = $(this).attr('href');
$.ajax({
url: url,
cache: false,
success: function(html) {
$contenu_div.hide().html(html).fadeIn();
}
});
return false;
});
});
</script>
</head>
<body>
<h2>Navigation AJAX with jQuery</h2>
<div id="menu">
<ul id="nav">
<li><a href="pages/page1.html">page 1</a></li>
<li><a href="pages/page2.html">page 2</a></li>
<li><a href="pages/page3.html">page 3</a></li>
<li><a href="pages/page4.html">page 4</a></li>
</ul>
</div>
<div id="content">
<div>the content of the first page</div>
</div>
<script src="problem.js"></script>
</body>
</html>
I have simplified the code
The ajax navigation work perfectly but the <script src="problem.js"></script> doesn't execute, what is the problem?

Cross-Origin Request Blockedis the problem that your code not execute