我正在使用JSF和PrimeFaces。我想在div中运行这个jquery load()方法。但它不起作用。在用于load()方法的HTML src中:https://code.jquery.com/jquery-1.10.2.js。其他src不适用于HTML中的load方法。问题是因为src还是PrimeFaces库?还运行其他jquery方法。只有加载方法不起作用。我该怎么办?
<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(document).ready(function(){
$("div#mydiv").load(function(){
alert("load method runs.");
});
});
</script>
<h:body>
<div id="mydiv">Example of jquery load method.</div>