javascript - Is there any other way to embed other web pages besides using iframe?
仅有的幸福
仅有的幸福 2017-05-19 10:17:11
0
1
973

Like the title, for example, if my page wants to embed baidu.com, is there any other way besides using iframe tags?

Origin of the problem: My project is nested in the android webview, but when I embed sina.com, qq.com, etc.; the webview will be forcibly occupied by these webpages.
Screenshots are as follows:
①Normal situation:

②Occupied status:

③Supplement:

    var iframe = '<p style="width: 100%; height: 100%;position:relative;">  <iframe src="' + this.data.itemData.url + '" style="width: 100%; height: 100%;" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" border="0" frameborder="0">如果长时间未加载,请检查网络状况或网址!</iframe><p' + '>';
        $this.appDom.html(iframe);

The reason has been found: As the respondent said, "There are many websites that don't like to be iframed and will use various means to jump out.", such as the code of a news website

<!-- 反运营商劫持 S -->
<style type="text/css">
    html {
        display:none;
    }
    </style>
<script>
    if( self == top ) {
        document.documentElement.style.display = 'block' ;
    } else {
        top.location = self.location ;
    }
    </script>

The solution has not been found yet

仅有的幸福
仅有的幸福

reply all(1)
仅有的幸福

Open webview on Android can be plural, communicate with the App to see.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template