Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 编辑js div match div代码,该代码在单独的链接上具有不同的结果_Javascript_Php_Html_Height_Current Page - Fatal编程技术网

Javascript 编辑js div match div代码,该代码在单独的链接上具有不同的结果

Javascript 编辑js div match div代码,该代码在单独的链接上具有不同的结果,javascript,php,html,height,current-page,Javascript,Php,Html,Height,Current Page,标题可能会让人困惑 我的js知识很差,因此需要帮助解决这个问题 <script type="text/javascript"> $(".content_R").css({'height':($(".content_L").height()+'px')}); $("#content_R").height($("#content_L").height() - 10); var highestCol = Math.max($(

标题可能会让人困惑

我的js知识很差,因此需要帮助解决这个问题

        <script type="text/javascript">
        $(".content_R").css({'height':($(".content_L").height()+'px')});
        $("#content_R").height($("#content_L").height() - 10);
        var highestCol = Math.max($('#content_R').height(),$('#content_R').height());
        $('#content_R').height(highestCol);
        </script>
显示一个复杂的cms编辑器。。。 似乎会影响脚本,使其100px太短! 我希望将此脚本包含在页脚中(每页都有) 所以我不想一次又一次地重复代码

有没有办法让下面的脚本简单地检查一下 如果网站是

edit-post.php?id='.$row['postID']
如果是这样,则将代码更改为:

        <script type="text/javascript">
        $(".content_R").css({'height':($(".content_L").height()+'px')});
        $("#content_R").height($("#content_L").height() + 100);
        var highestCol = Math.max($('#content_R').height(),$('#content_R').height());
        $('#content_R').height(highestCol);
        </script>

$(“.content_R”).css({'height':($(“.content_L”).height()+'px')});
$(“内容”)高度($(“内容”)高度()+100);
var highestCol=Math.max($('content_R').height(),$('content_R').height());
$('content_R')。高度(最高的列);

提前感谢

window.location.pathname将保留当前加载脚本的路径。您可以在运行其余的js之前检查它的值

        <script type="text/javascript">
        $(".content_R").css({'height':($(".content_L").height()+'px')});
        $("#content_R").height($("#content_L").height() + 100);
        var highestCol = Math.max($('#content_R').height(),$('#content_R').height());
        $('#content_R').height(highestCol);
        </script>