Javascript 在codeigniter错误中使用jquery加载页面内容
我有一个主页,它有几个表,每隔几秒钟就会刷新一次 下面是视图中jquery文件(inside_view.php)的代码 下面是(ajax\u home\u en.php)代码Javascript 在codeigniter错误中使用jquery加载页面内容,javascript,jquery,codeigniter,load,codeigniter-url,Javascript,Jquery,Codeigniter,Load,Codeigniter Url,我有一个主页,它有几个表,每隔几秒钟就会刷新一次 下面是视图中jquery文件(inside_view.php)的代码 下面是(ajax\u home\u en.php)代码 CP码 代码 名称 当我尝试使用此url查看此页面时,一切正常 但是一旦我输入这个url 还是这个 显示内部()视图而不是主视图。n将在框中连续刷新页面(并使我的IE停止响应) 我不明白为什么在URL中添加“/”或/索引会导致这样的错误,我的javascript出现错误了吗 先进的thx 相对链接可能有问题,请
CP码
代码
名称
当我尝试使用此url查看此页面时,一切正常
但是一旦我输入这个url
还是这个
显示内部()视图而不是主视图。n将在框中连续刷新页面(并使我的IE停止响应)
我不明白为什么在URL中添加“/”或/索引会导致这样的错误,我的javascript出现错误了吗
先进的thx 相对链接可能有问题,请尝试:
$(function() {
$("#encontainer").load("/inside/home_en");
var refreshId = setInterval(function() {
$("#encontainer").load('/inside/home_en?randval='+ Math.random());
}, 9000);
$.ajaxSetup({ cache: false });
});
THX老兄$(“#encontainer”).load(“/inside/home#en”)$(“#incontainer”).load('/inside/home_en?randval='+Math.random());不起作用,但我把斜杠改成了,一切都变好了。
function index(){
// Write to $title
$this->template->write('title', 'Update to date data');
$this->template->write_view('header', 'header_content', true);
// Write to $content
$this->template->write_view('content', 'inside_view', true);
// Write to $sidebar
$this->template->write_view('sidebar', 'user_side_menu');
// Load and display the template
$this->template->load();
}
function home_en(){
//look latest enquirer data
$data['enresults'] = $this->customer_model->get_cp_list(5);
$this->load->view('ajax_home_en',$data);
}
<link type="text/css" rel="stylesheet" href="http://bravonet.my/tombocrm/assets/css/table.css" />
<?php if($enresults->num_rows() == 0){
echo 'No data result, please insert one';
}else{
?>
<table width="100%">
<tr>
<th>CP code</th>
<th>Code</th>
<th>Name</th>
</tr>
<?php foreach($enresults->result() as $row){
echo '<tr class="tr'. alternator('1', '2'). '">';
?>
<td align="center"><?php echo $row->cp_code?></td>
<td align="center"><?php echo $row->en_code?></td>
<td align="center"><?php echo $row->name?></td>
<td align="center"><?php echo anchor('customers/patient_update_view/'.$row->eid,'Edit');?></td>
<td align="center"><?php echo anchor('customers/cp_details_view/'.$row->cpid,'View');?></td>
</tr>
<?php }?>
</table>
<?php
echo anchor('customers','View all data');
} ?>
<div id="encontainer"></div>
$(function() {
$("#encontainer").load("/inside/home_en");
var refreshId = setInterval(function() {
$("#encontainer").load('/inside/home_en?randval='+ Math.random());
}, 9000);
$.ajaxSetup({ cache: false });
});