Please note that YouTube offers you to serve videos from the alternative domain which doesn't use HTTP cookies. * Remember to replace the example- URL '' with the URL that points to the content you want to display. To manually implement prior consent, edit the original iframe tag (for example): If you have auto blocking enabled, then the marking up of iframes should be handled automatically by the Cookiebot script. On subsequent page requests where the visitor has already submitted a consent, the iframe content will automatically load in accordance with a visitor's consent state. When consent is submitted, the Cookiebot script will determine if the conditions for loading the content of the iframe are met, and enables the iframe if this is the case. To be able to enable the iframe when consent has been given, the data-cookieconsent attribute must be added with one of these values: 'preferences', 'statistics', or 'marketing'. This can be done by replacing the src attribute with data-src (or data-cookieblock-src if data-src is already being used by for example lazy loading). To do this, the iframe must essentially be disabled prior consent. To ensure no cookies are set before a website visitor has consented to their use, loading of the video must be postponed until the visitor has consented. style.border="none" // For IE.Website content loaded in iframes from third party content providers, for example YouTube may set cookies and thereby require a visitor's consent. tAttribute("frameBorder", "0") // For other browsers (just a backup for the above). Var iFrameElements = ("iframe") įor (var i = 0 i < iFrameElements.length i++) Took me MANY hours of working to the point of despair to figure this out.Įnjoy. (or just let IE look fugly-my current favorite option ) ) If that happens, your only option is to set it before it is generated, as others have noted, or use the non-standard frameBorder="0" attribute. Otherwise the script will get "access denied" errors in the IE error console. Note: The IE part will only work (of course) if the parent window and iframe are from the SAME origin (same domain, port, protocol etc.). This appears to work because IE creates the border, not on the iframe element as you'd expect, but on the CONTENT of the iframe-after the iframe is created in the BOM. iframes that are added in plain HTML and not JavaScript)! AND it will work even if used AFTER the iframe is generated and in place in the document (e.g. It will find any iframe elements and remove their borders in IE and other browsers (though you can just set a style of "border : none " in non-IE browsers instead of using JavaScript). You can also do it with JavaScript this way. But in near future it will be the standard solution and will be compatible with all browsers. As of now, The seamless attribute of the tag is only supported in Opera, Chrome and Safari. When present, it specifies that the iframe should look like it is a part of the containing document (no borders or scrollbars). The seamless attribute of the iframe tag is only supported in Opera, Chrome and Safari. You can also remove scrolling using scrolling attributeĪlso you can use seamless attribute which is new in HTML5. But, the iframe frameborder attribute is not supported in HTML5. Note: use frame Border (cap B) for IE, otherwise will not work. Use the HTML iframe frameborder Attribute
0 Comments
Leave a Reply. |