我遇到了问题。我有我的index.php,其中包含登录用户后面的html代码。
例如,如果用户被定义为“demandeur”,则index.php将加载“demandeur.php”。有一个jquery脚本文件和css文件,由“demandeur.php”加载。一切都已加载并正常使用Firefox,但在IE8上无法正确加载它,因为我收到错误“是null或不是对象”。每一次。
简历:
index.php whith[debug.js, bootstrap.js, jquery.js] --> include (demandeur.php with [demandeurScript.js, demandeur.css])
当demandeurScript.js在debug.js中调用函数时,我得到错误“debug is null或not object。”
的index.php
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="images/favicon.png">
<title>OAPTHD</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Bootstrap core JavaScript -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>
<!--<script src="js/jquery-2.1.0.min.js"></script>-->
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/jquery.placeholder.js" type="text/javascript"></script>
<script src="js/jquery.hideshow.js" type="text/javascript"></script>
<script src="js/debug.js" type="text/javascript"></script>
<script src="js/jquery.gritter.min.js" type="text/javascript"></script>
<script src="js/jquery.validate.min.js" type="text/javascript"></script>
<script src="js/fileuploader.js" type="text/javascript"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=blablabla&sensor=false&extension=.js" type="text/javascript"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js" type="text/javascript"></script>
<script src="js/respond.min.js" type="text/javascript"></script>
<![endif]-->
</head>
<body>
<!-- Chargement de la page demandée -->
<?php include("./php/authentification/verifieLogin.php");?>
</body>
</html>
</html>
verifielogin.php
<?php
//header('Content-Type: text/html; charset=UTF-8');
include('php/log.php');
session_start();
log_php("_SESSION[login] = " . $_SESSION['login']);
if (!isset($_SESSION['login'])){
log_php("Aucune session init, redirection vers formulaire.php");
header ("location: ./php/pages/formulaire.php");
exit();
} else {
switch ($_SESSION['droitUtilisateur']) {
case "4":
log_php("include de ./php/pages/demandeur.php");
include("./php/pages/demandeur.php");
//exit();
break;
case "3":
log_php("include de ./php/pages/valideur.php");
include("./php/pages/valideur.php");
//exit();
break;
case "2":
log_php("include de ./php/pages/c2eupr.php");
include("./php/pages/c2eupr.php");
//exit();
break;
default:
log_php("include de ./index.php");
include("location: ./index.php");
//exit();
}
}
?>
demandeur.php
<!-- Custom styles for this template -->
<link href="css/fileUploader.css" rel="stylesheet">
<link href="css/demandeur.css" rel="stylesheet">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div id ="home" class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#home">OAPTHD</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#home" id="menuHome" class="lienMenu">Home</a></li>
<li class="dropdown"><a class="dropdown-toggle lienMenu" data-toggle="dropdown">Etudes<b class="caret" class="lienMenu"></b></a>
<ul class="dropdown-menu" id="ulDropdownEtudes">
</ul>
</li>
<li class="dropdown"><a class="dropdown-toggle lienMenu" data-toggle="dropdown">Mes Demandes<b class="caret" class="lienMenu"></b></a>
<ul class="dropdown-menu">
<li><a href="#mesDemandes" id="menuToutes" class="dropdownMesDemandes">Toutes</a></li>
<li><a href="#mesDemandes" id="menuEnCours" class="dropdownMesDemandes">En cours</a></li>
<li><a href="#mesDemandes" id="menuFinalisees" class="dropdownMesDemandes">Finalisées</a></li>
</ul>
</li>
</ul>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a id="labelNomUtilisateur" ></a></li>
<li><a id="boutonDeconnection">Déconnection</a></li>
<li><a id="boutonAide">Aide</a></li>
</ul>
</div>
</div><!--/.navbar-collapse -->
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Application OAPTHD !!!</h1>
<p>
<?php
$date = date("d/m/Y");
$heure = date("H:i");
Print("<em>Bonjour, Nous sommes le $date et il est $heure</em>");
?>
</p>
<p>This is a TEST template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-ttc btn-lg" role="button">Learn more »</a></p>
</div>
</div>
<div class="container">
<div id ="demandes" class="row">
</div>
<hr>
<footer>
<p>© -
<a href="#"></a>
-
<a href="#" target='_blank'>Pawlak Steven</a>
</p>
<img src="images/logo.jpg" alt="logoS" name="logo" width="83" height="36" id="logoOBS">
</footer>
</div> <!-- /container -->
<script src="scripts/demandeurScript.js" type="text/javascript"></script>
如何通过它? 谢谢, 最好的问候。