Embed a third-party parser (a player) on the playback page. On the mobile playback page - there is an advertisement with a height of 93 and an adaptive width at the bottom of the player ~ as shown, the advertisement is very eye-catching, please help, how to block it, or Is it possible to directly use JS to prevent this ad from loading?
If it is a third-party page, then the iframe embeds a webpage with a different domain name. The browser has security restrictions and is not allowed to access this page. I would like to think about whether there is a way to embed a webpage address that does not contain advertisements
You can remove it with $("#iframe的ID").contents().find("#iframe中的廣告ID").remove()
Generally speaking, there are cross-domain problems when operating embedded iframes,
沒有跨域問題用 js方法 獲取iframe里面的對(duì)象 來操作是可取的;
有跨域問題,用兩個(gè)層來做控制,外層包iframe和p:
<p style="position:relative;height:200px;width:400px;border:1px solid red;">
<iframe src="http://netnr.com" style="position:absolute;width:100%;height:100%"></iframe>
<p style="position:absolute;bottom:0;left:0;right:0;height:93px;background-color:white;">
已屏蔽廣告
</p>
</p>
Upgrade the website to prevent https hijacking. You can apply for a free certificate startsll or let's encrypt