iframe无法正确呈现

时间:2010-12-22 18:14:39

标签: html iframe

所以我试图运行一个显示客户端安全摄像头源的网页。但它根本无法正确渲染,只显示背景。我有一种感觉它与iframe标签的限制有关,因为在线使用其他iframe测试小工具我得到相同的结果。其他客户正在使用具有不同界面的摄像头源,我的解决方案适用于他们。 iframe还有其他选择吗?

编辑:页面实际上在直接访问时呈现完美,而不是通过iframe。

edit2:此处受欢迎的请求是安全提要网站的来源。我没有发布我的iframe代码,因为无论我使用什么iframe它都不会显示。

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<meta http-equiv="expires" content="-1">

<title>:::</title>

<script language="JavaScript" src="/js/lgSource.js"></script>

<script language="JavaScript" src="/js/data_init.js"></script>

<script language="javascript" src="/js/AVUtility.js"></script>



<script language="JavaScript">

var d = document ;

d.write( "<frameset frameSpacing=0 rows='37,*' frameBorder='no' >" ) ;

d.write( "    <frame name='ban' src='' scrolling='no'>" ) ;

d.write( "    <frameset frameSpacing=0 frameBorder='no' cols='*,195'>" ) ;

d.write( "        <frame name='main' src='home.htm' scrolling='auto'>" ) ;

d.write( "        <frame name='left' src='' noResize scrolling='no'>" ) ;

d.write( "    </frameset>" ) ;

d.write( "</frameset>" ) ;

d.write( "<noframes><body><p>no frame</p></body></noframes>" ) ;



var httpObj,httpObj2,httpObj3;

//alert("Code in NFS. H264 \n\n charset=utf-8");

//top.dt.user.SupportLG = "ENGLISH&CHINESE&"

loadSupportLanguage();

//loadUserPwd();



function loadSupportLanguage() 

{   

    httpObj3 = createHttpRequestObj();

    requestData = "http://"+getURL()+"/cgi-bin/nobody/Machine.cgi?action=get_capability";   

    httpObj3.onreadystatechange = updSL;

    requestCgiParam(httpObj3, requestData);

}



function updSL() 

{

    if (httpObj3.readyState == 4 && httpObj3.status == 200) 

    {

        var objStr    = new Object();

        objStr.strSrc = httpObj3.responseText;



        if (GetCgiParam(objStr,"Language.Support=") == 1)

            if (objStr.strGet != "")

                top.dt.user.SupportLG = objStr.strGet;



        loadUserPwd();

    }

}



function loadUserPwd() 

{   

    httpObj = createHttpRequestObj();

    requestData = "http://"+getURL()+"/cgi-bin/guest/UserInfo.cgi?action=query";    

    httpObj.onreadystatechange = updUserPwd;

    requestCgiParam(httpObj, requestData);

}



function updUserPwd() 

{

    if (httpObj.readyState == 4 && httpObj.status == 200) 

    {

        var objStr    = new Object();

        objStr.strSrc = httpObj.responseText;



        if (GetCgiParam(objStr, "Username=") == 1)

            top.dt.user.username = objStr.strGet;



        if (GetCgiParam(objStr, "Password=") == 1)

            top.dt.user.password = objStr.strGet;



        loadLogin();

    }

}



function loadLogin()

{

    httpObj2 = createHttpRequestObj();

    requestData = "http://"+getURL()+"/cgi-bin/guest/Login.cgi?rnd="+Math.random();

    httpObj2.onreadystatechange = updLogin;

    httpObj2.open("get", requestData, true);

    httpObj2.send(null);

}



function updLogin() 

{

    if (httpObj2.readyState == 4 && httpObj2.status == 200) 

    {

        var objStr    = new Object();

        objStr.strSrc = httpObj2.responseText;



        if (GetCgiParam(objStr,"Server-Language=") == 1)

        {

            if(objStr.strGet.toUpperCase() == "CHINESE")

                top.dt.user.language = 2;

            else if(objStr.strGet.toUpperCase() == "GREEK")

                top.dt.user.language = 3;

            else

                top.dt.user.language = 1;

        }



        if (GetCgiParam(objStr, "Video-System=") == 1)

            top.dt.user.VideoSystem = objStr.strGet;



        if (GetCgiParam(objStr, "User-Level=") == 1)

            top.dt.user.ulevel = objStr.strGet;



        if (GetCgiParam(objStr, "Product-ShortName=") == 1)

        {

            if(objStr.strGet == "V_Indep")

                top.dt.user.IndepFlag = true;

        }



        //top.dt.user.NatSupport = true;

        //top.dt.user.PosSupport = true;

        if (GetCgiParam(objStr, "Capability=") == 1)

        {

            tmpStr = objStr.strGet.split(",");

            if(tmpStr.length==4){

                if(parseInt(tmpStr[3],16)&0x01)

                    top.dt.user.isDvrPtz = true;



                if(parseInt(tmpStr[2],16)&0x01)

                    top.dt.user.DvrHaSupport = true; // HA



                if(parseInt(tmpStr[2],16)&0x02)

                    top.dt.account.NotifySys = true; //3G Notify



                if(parseInt(tmpStr[2],16)&0x04)

                    top.dt.user.NatSupport = true; //NAT



                if(parseInt(tmpStr[2],16)&0x08)

                    top.dt.user.RfidSupport = true; //RFID



                if(parseInt(tmpStr[1],16)&0x01)

                    top.dt.user.PosSupport = true; //POS



            }

        }



        if (GetCgiParam(objStr, "Product-ID-Minor=") == 1)

        {

            top.dt.user.ProductID = objStr.strGet;

            var pid = objStr.strGet;



            // Video Channel (default: 4 ch)

            if(pid == "787" || pid == "718" || pid == "616" || pid == "757" || pid == "677" || pid == "678" || pid == "DG1648" || pid == "798"){

                top.dt.user.dvrCh = 16;

            }

            else if (pid == "785" || pid == "608" || pid == "716" || pid == "755" || pid == "675" || pid == "676" || pid == "DG0824" || pid == "796"){

                top.dt.user.dvrCh = 8;

            }

            else if (pid == "783" || pid == "604" || pid == "604F" || pid == "714" || pid == "724" || pid == "DG0412" || pid == "763" || pid == "764" || pid == "760A" || pid == "761A" || pid == "041"){

                top.dt.user.dvrCh = 4;

            }

            else{

                top.dt.user.dvrCh = 4; /* default 4 ch */

            }



            // Audio Channel

            if(pid == "DG0824" || pid == "608" || pid == "DG1648" || pid == "616" || pid == "718" || pid == "757" || pid == "755" || pid == "675" || pid == "676" || pid == "677" || pid == "678" || pid == "724" || pid == "764" || pid == "673" || pid == "674" || pid == "683" || pid == "796" || pid == "798"){

                top.dt.user.soundCh = 4;

            }

            else if (pid == "732E" || pid == "DG0412" || pid == "714"){

                top.dt.user.soundCh = 2;

            }

            else if (pid == "733" || pid == "944" || pid == "945" || pid == "946" || pid == "311" || pid == "321" || pid == "202" || pid == "212" || pid == "604F" || pid == "203" || pid == "671" || pid == "672" || pid == "681"){

                top.dt.user.soundCh = 1;

            }

            else{

                top.dt.user.soundCh = 0;

            }



            //Top-Page

            if(top.dt.user.ulevel != "SUPERVISOR" || pid == "203" || pid == "763")

                top.dt.user.topSrc  = "/top2.htm";

            else

                top.dt.user.topSrc  = "/top.htm";



            //show Left-Page

            if(pid == "311" || pid == "321"){

                top.dt.user.leftSrc = "/left_ipcam.htm";

                top.dt.user.confSrc = "/left_ipcam_config.htm";

                top.dt.user.ProductType = "IP CAMERA";

                top.dt.user.isAutomoveSupport = true;

            }

            else if(pid == "203"){

                top.dt.user.leftSrc = "/left_ipcam_h264.htm";

                top.dt.user.ProductType = "IP CAMERA";

            }

            else{

                if(pid == "763"){

                    top.dt.user.leftSrc = "/left_home763.htm";

                }else if(pid == "798" || pid == "796"){

                    top.dt.user.leftSrc = "/left_home16ch.htm";

                }

                else{

                    top.dt.user.leftSrc = "/left_home.htm";

                }

                top.dt.user.confSrc = "/left_config.htm";

                top.dt.user.ProductType = "DVR";

            }



            //show Title

            if(pid == "764" || pid == "671" || pid == "672" || pid == "673" || pid == "674" || pid == "681" || pid == "683" || pid == "203" || pid == "796" || pid == "798" || pid == "041"){

                top.dt.user.MediaType = "H264";

                document.title = "H264 "+ top.dt.user.ProductType;

            }

            else

                document.title = "MPEG4 "+ top.dt.user.ProductType;



            if(top.dt.user.ulevel == "SUPERVISOR")

                if(top.dt.user.ProductType == "DVR")

                    loadRecImageSize();

                else

                    chkNatFirstUse();

            else

                loadMainPage();

        }

    }

}



function loadRecImageSize() 

{   

    httpObj = createHttpRequestObj();

    var requestData = "http://"+getURL()+"/cgi-bin/user/Config.cgi?action=get&category=DVR.Record.*";

    httpObj.onreadystatechange = updRecImageSize;

    requestCgiParam(httpObj, requestData);

}



function updRecImageSize() 

{

    if (httpObj.readyState == 4 && httpObj.status == 200) 

    {

        var objStr    = new Object();

        objStr.strSrc = httpObj.responseText;



        if (GetCgiParam(objStr,"ImageSize=") == 1){

            top.dt.user.DVR_Record_ImageSize = objStr.strGet;

            chkNatFirstUse();

        }

    }

}



function chkNatFirstUse() 

{   

    httpObj = createHttpRequestObj();

    var requestData = "http://"+getURL()+"/cgi-bin/user/Config.cgi?action=get&category=Network.NAT.*";

    httpObj.onreadystatechange = updNatFirstUse;

    requestCgiParam(httpObj, requestData);

}



function updNatFirstUse() 

{

    if (httpObj.readyState == 4 && httpObj.status == 200) 

    {

        var objStr    = new Object();

        objStr.strSrc = httpObj.responseText;



        var FirstUseNatFlag = false;

        if (GetCgiParam(objStr,"FirstUse=") == 1)

            if(objStr.strGet == "YES")

                FirstUseNatFlag = true;



        if (GetCgiParam(objStr,"Hostname=") == 1)

            top.dt.user.NatName = objStr.strGet;



        if(FirstUseNatFlag)

            showNatFirstUseWeb();

        else

            loadMainPage();

    }

}



function showNatFirstUseWeb()

{

    top.ban.location.replace("/top2.htm");

    top.left.location.replace("/left_empty.htm");

    top.main.location.replace("/combo/nat_firstuse.htm");

}



function loadMainPage()

{

    top.dt.user.mainSrc = "/home.htm";

    top.ban.location.replace(top.dt.user.topSrc);

    top.left.location.replace(top.dt.user.leftSrc);

}

</script>

</html>

1 个答案:

答案 0 :(得分:1)

  

该页面实际上呈现完美   直接访问时很好,和   不是通过iframe。

我唯一能想到的是该页面有一个帧破坏技术。

您可以阅读一些here

没有代码,我无法帮助你!