dpx49470 2017-02-15 13:48
浏览 20

即使有源代码,Laravel刀片视图页面也是空的

My blade view shows a empty page, but if I press CTRL + U to show the source code, then I get this:

<!DOCTYPE html>
<html>
<head>
    <link rel='stylesheet' href='http://localhost/portal_testing/public/css/style.css'/>
    <script src='http://localhost/portal_testing/public/js/main.js'/>
</head>
<body>
    <div>   
        <div class='infoBox'>
            <h4 class='infoBoxTitle'>Log:</h4>
            <div class='infoBoxContent'> 
               <p>test</p>
            </div>
        </div>

        <div class='errorBox'>
            <h4 class='errorBoxTitle'>Error Log:</h4>
            <div class='errorBoxContent'> 
               <p>test</p>
            </div>
        </div>
    </div>
</body>
</html>

Why is it not rendering even though there is valid code?

UPDATE:


Javascript:

//Accordion:
var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
    acc[i].onclick = function(){
        this.classList.toggle("active");
        var panel = this.nextElementSibling;
        if (panel.style.display === "block") {
            panel.style.display = "none";
        } else {
            panel.style.display = "block";
        }
    }
}

CSS

.infoBox {
    font-family: arial;
    padding:2px;
    background-color: #DADADA;
    min-width: 300px;
    min-height: 100px;
    margin:2px;
    border:1px solid black;
}

.infoBoxTitle {
    padding:4px;
    font-size: 13px;
    color: red;
    margin: 1px;
    text-decoration: underline;

}

.infoBoxContent {
    font-size: 10px;
    padding-left:5px;
    margin-left:10px;
    border: 1px solid gray;
}

.errorBox {
    font-family: arial;
    padding:2px;
    background-color: #838383;
    min-width: 300px;
    min-height: 100px;
    margin:2px;
    border:1px solid black;
}

.errorBoxTitle {
    padding:4px;
    font-family: calibry;
    font-size: 13px;
    color: white;
    margin: 1px;
    text-decoration: underline;
}

.errorBoxContent {
    color: white;
    font-size: 11px;
    padding-left:5px;
    margin-left:10px;
    border: 4px solid white;
}
  • 写回答

1条回答 默认 最新

  • dq05304 2017-02-15 14:10
    关注

    I found the problem... I noticed that all the content was rendered inside of the script tag:

    inspect html

    The reason is, becaues the script element was missing it's closing tag.


    Fix:

    <script type="text/javascript" src='{{ URL::asset("js/main.js") }}'></script>
    
    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP