我在head标签中调用了以下函数。
Page::IncludeJavascriptFile('js/packages.js');
Page::AddHeadElement('
<script type="text/javascript">
$(document).ready(function() {
pollClientTable('.TriplecastConfig::get('transfer_polling_period')*1000 .', true);
});
</script>
');
pollClientTable在函数调用之前的packages.js中定义。
pollClientTable函数:
var pollClientTableTimer = null;
var pollClientTableTimerPoll = null;
function pollClientTable(poll, async) {
clearTimeout(pollClientTableTimer);
$.ajax({
url: "ajax_requests/getClientPackages.php",
async: async,
timeout: poll,
success: function(data) {
$('#packagesForm').empty();
$('#packagesForm').append(data);
}
});
pollClientTableTimerPoll = poll;
pollClientTableTimer = setTimeout(function(){pollClientTable(poll, true);}, poll);
}
这些功能适用于任何其他浏览器栏IE8。有什么想法吗?