[英]jQuery plugin not working on jquery hash loaded page
I have my php page loaded with hash, and the page is with jquery plugin dataTable, 我的php页面加载了哈希,并且该页面包含了jquery插件dataTable,
plugin is loaded but not working, if i reload page, then it is working. 插件已加载但无法正常工作,如果我重新加载页面,则说明该工作正常。 ..but not working with jquery ajax loaded with hash. ..但不适用于加载了哈希值的jquery ajax。
PHP page contain following script loaded: PHP页面包含以下脚本加载:
<link rel="stylesheet" media="screen" href="lib/datatables/css/vpad.css" />
<script type="text/javascript" src="js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType": "full_numbers"
} );
} );
</script>
ok do some thing like this 好,做这样的事情
place this code in your ajax loaded page .... 将此代码放在ajax加载的页面中。
<script type="text/javascript">
$('#example').dataTable( {
"sPaginationType": "full_numbers"
} );
</script>
this is because data table not working in live loaded pages . 这是因为数据表在实时加载的页面中不起作用 。 there are other many ways to do this but this is simple and easy 100% works 还有其他许多方法可以做到这一点,但这很简单100%可行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.