获取iframe标记属性sandbox
默认
“”应用以下所有限制: 可以使用allow-same-origin将iframe的内容视为与包含文档相同的源。 使用allow-top-navigation,可以从包含文档中导航(加载) iframe内容。 allow-forms允许提交表格。 allow-scripts允许脚本运行。
JQ设置手机端和电脑端的展示
varis mobile={ Android : function (} { return navigator.user agent.match )/Android/I )? 真:假;黑莓: function () return navigator.user agent.match ) /黑莓/I )? 真:假;iOS: function () return navigator.user agent.match )/iphone|ipad/I )? 真:假;Windows: function () return navigator.user agent.match )/iemobile/I )? 真:假;any: function () return ) ismobile.Android )|| is mobile.blackberry|| is mobile.IOs|} ; if(ismobile.any () ) ) /通过手机访问时的操作! variframepage=document.getelementbyid (iframe page ); $('#iframepage ' ).attr(sandbox,' allow-formsallow-same-original low-top-navigation ); } else { variframepage=document.getelementbyid (iframe page ); $('#iframepage ' ).attr(sandbox,' allow-scripts allow-formsallow-same-original low-top-navigation ' ) ) }