duanjue9889 2015-12-10 19:25
浏览 42

PHP包括不在JQuery .load中工作

I have this code on my index.php page:

require_once 'includes/settings.php';

require_once 'includes/data_functions.php';

if($_GET["section"] == '1') {
    require_once 'includes/includes.php';

    require_once 'pages/'.$_GET["id"].'.php';
    exit();
}

<!DOCTYPE html>
<html>
<head>

<meta charset="UTF-8">
<title>Integra | <?php echo $PageTitle; ?></title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

<?php require_once 'includes/includes.php'; ?>

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>

<body class="skin-black-light sidebar-mini sidebar-collapse">

and i use JQuery .load to load pages into a popup div, when loading the page it has the $_GET variable section = 1 so it runs the above code

here is the function that i use to .load pages:

function LoadModal(page, title) {
    title = title || '';

    $( "#modal_page" ).fadeIn("slow");
    $( "#modal_title" ).html(title);

    $("#modal_page_body").html('<h2 align="center">Loading...</h3><p align="center"><i class="fa fa-refresh fa-spin fa-5x"></i></p>'); //$('#LoadingDiv').show();
    $("#modal_page_body").load(page, function(){

    });
    $("html, body").animate({ scrollTop: 0 }, "slow");
}

and then to call this function:

<a href="#" onClick="LoadModal(\'/section/page?seq=add\', \'Add\');" title="Add"><i class="fa fa-plus"></i></a>

so the includes.php file is included in all pages.

this includes some jquery files which have some functions in.

when opening a page in the popup using jquery .load these specific jquery funtcions are not working at all however if i remove the $_GET var (section = 1) to open the page not in the jquery popup (.load) the functions are working fine

what could be causing these to stop working only in the jquery .load

  • 写回答

1条回答 默认 最新

  • dongxing1965 2015-12-10 19:39
    关注

    Your URL (/section/page?seq=add) doesn't include section=1 in the query string, so $_GET['section'] is not set.

    评论

报告相同问题?

悬赏问题

  • ¥15 touchsocket udp组播
  • ¥20 MAC怎么安装Silverlight 插件?以及安装了怎么启用
  • ¥15 VS2012中查询语句无法填入解析,数值传不进去
  • ¥15 gis系统开发出现命名空间“ESRI.ArcGIS”中不存在类型或命名空间名“Analyst3D”报错
  • ¥15 怎么让ai定时给我发信息 c#或者python
  • ¥15 scrapy的Error
  • ¥15 RBF-VSG姚凤军论文复现问题
  • ¥30 开发一个APP商城在制作tabbar的时候运行不了代码没有检查出错误,但是显示不出tabbar,以下为运行结果,如何解决?
  • ¥15 多网卡服务器中winform如何绑定指定网卡
  • ¥15 关于#python#pandas#的问题,想要实现:多个TXT导入Excel,进行分列,不同txt之间都从第一行开始,请各位专家解答!