【发布时间】:2014-06-04 12:44:28
【问题描述】:
我正在尝试使用 jquery 自动刷新。但我的页面不会自行重新加载
这是我的控制器:
class Count_controller extends CI_Controller {
public function index()
{
$this->load->view('count_view', @a);
}
public function table()
{
$a = rand(1000, 5000);
echo $a;
}
}
这是我的观点:
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
setInterval("auto_refresh_function();", 500);
function auto_refresh_function() {
$('#load_content').load('http://demo1.com/demo/count_controller/table');
}
</script>
</head>
<body>
<div id="load_content">Loading</div>
</body>
</html>
这是我的 .htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|static|js|css|gif|png|jpg|robots\.txt|html)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
有人可以帮助我吗?
谢谢
【问题讨论】:
-
console中的任何错误? CSRF 开启了吗? -
不,控制台没有错误。什么是 CSRF?
-
有什么理由不只在元标记中这样做吗?
标签: php jquery .htaccess codeigniter