繁体   English   中英

为什么Firebug无法检测到某些JavaScript?

[英]Why is Firebug unable to detect some JavaScript?

我在<body>结束标记之外编写了JavaScript。 Firebug无法检测到JavaScript,而我也无法检测到JavaScript错误。

这是我的代码:

</body>
<script type="text/javascript">

function displayIFrameContent()
{   
    var iFrame = document.getElementById("link");
    var if1= "<iframe src='http://leadmarket.hol.es/forms/solar-power.php?adv_id=" + <?php echo($fetch_users_data['id']); ?>; 
    var if2= "<iframe src='http://leadmarket.hol.es/forms/kitchen-installation.php?adv_id=" + <?php echo($fetch_users_data['id']); ?>; 
    var if3= "<iframe src='http://leadmarket.hol.es/forms/conservatory.php?adv_id=" + <?php echo($fetch_users_data['id']);; ?>; 

    var host = document.getElementById("host");
    var subId = document.getElementById("subid");
    var errorClass = "box form-validation-error border-width-2";

    if(host.value == "")
        changeClass("host", errorClass);

    if(host.value != "")
    {       
        var iFrameEnd = " width='280' height='330' frameborder='0' scrolling='no'></iframe>";

        var leadTypeSelect = document.getElementById("leadType");
        var leadTypeValue = leadTypeSelect.options[leadTypeSelect.selectedIndex].value;

        iFrame.value  = "";

        if(leadTypeValue == 1)
            iFrame.value  = if1 + "&" + "sub_id=" + subId.value + "&source=" + host.value + "'" + iFrameEnd;

        if(leadTypeValue == 2)
            iFrame.value  = if2 + "&" + "sub_id=" + subId.value + "&source=" + host.value + "'" + iFrameEnd;

        if(leadTypeValue == 3)
            iFrame.value  = if3 + "&" + "sub_id=" + subId.value + "&source=" + host.value + "'" + iFrameEnd;
    }       
}


function changeClass(id, classname) 
{
    document.getElementById(id).setAttribute("class", classname);
}   
</script>
</html>

您的帮助将不胜感激。 提前致谢!

上面的代码包含PHP标记,这会导致一些语法错误。 在这种情况下,“脚本”面板仅显示一条消息“此页面上没有Java脚本”。 在将它们输出到浏览器之前,应确保它们已被PHP解释。

控制台面板中还会列出JavaScript语法错误。 确保选中“ 显示JavaScript错误 ”选项以查看它们。

此外,Firebug Wiki中提供了有关脚本调试的详细说明

塞巴斯蒂安

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM