コードイグナイターでアプリケーションを作成しました。コードイグナイターDoc Type
私は<!DOCTYPE HTML>
をindex.php(コードイグナイターが提供するルートディレクトリのファイル)の冒頭に宣言しない限り、Interenet Explorerは自分自身をクォークモードに強制し、自分のページを完全に駄目です。私は運がないと私の意見の冒頭に置くことを試みた。
これは通常問題ではありませんが、コントローラーの1人がビューでJSON応答を返すモバイル認証システムに電力を供給し、<!DOCTYPE HTML>
が応答を妨げています。
なぜ、私のビューの一番上に置かれたときに、ドキュメントタイプの宣言が無視されるのですか? index.phpの先頭に置かれたときにはなぜ動作しますか?
さらに重要なことは、どうすればこの問題を回避できますか?
ありがとうございました!
EDIT:
public function login()
{
?><script type="text/javascript">console.log("Admin log in panel loaded");</script><?php
//This method will have the credentials validation
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'trim|required|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|callback_checkDatabase');//Database gets queried with a call-back here.
//Set custom validation messages:
$this->form_validation->set_message('checkDatabase', 'Invalid credentials');
//This is executed when the form is submitted
if($this->form_validation->run() == FALSE)
{
//Field validation failed. User remains on login page.
$this->load->view('header');
$this->load->view('useradminviews/login');
$this->load->view('footer');
} else {
//Login successful, redirect to admin dashboard
?><script type="text/javascript">console.log("User logged in successfully");</script><?php
redirect('useradmin?login', 'refresh');
}
}
これはheader.phpのである:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>COFRA</title>
<link rel="icon" type="image/png" href="<?php echo base_url();?>/images/favicon.png" />
<script type="text/javascript" src="<?php echo base_url();?>/javascript/jquery.js"></script>
<?php
//Load different CSS for IE users:
if ($this->agent->is_browser('Internet Explorer'))
{
?>
<link href="<?php echo base_url();?>/javascript/placeholder/css/style.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="<?php echo base_url();?>/css/COFRAIE.css" rel="stylesheet" type="text/css" media="screen"/>
<script type="text/javascript" src="<?php echo base_url();?>/javascript/placeholder/js/jquery.placeholder.js"></script>
<?php
} else {
?><link href="<?php echo base_url();?>/css/COFRA.css" rel="stylesheet" type="text/css" media="screen"/><?php
}
?>
</head>
ビューをロードするコードの関連部分を表示できますか? – Ben
ねえ、確かに、コード –