I have an HTML page with jQuery inside and JavaScript.
I’m importing the libraries I need in the head tag:
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places" type="text/javascript"></script>
Then I’m importing some html with jQuery inside:
$('#cliente').click(function(){$('#container').load('/clienti/cliente');});
But the jQuery inside the page loaded is not working. (I’m sure the code is right as is working standing alone).
I need to do something? I have tried to import the libraries in the imported page before the script (out of the head), but not working.
I haven’t other ideas!
.load()only works for HTML the way you’re using it. (see the section titled “Script Execution”). It won’t evaluate any script inside the HTML you load. What you want is to load it using a suffix, i.e.