我试图改变iframe中内容的CSS。 即我需要隐藏<img>
元素。 但我cannnot改变.. 下面是示例代码:如何控制动态加载到iframe中的内容的CSS?
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<iframe src="http://www.carsales.com.au/pls/carsales/!dealer_content.welcome?dealer_id=10978" width="80%" height="600" id='frameDemo'></iframe>
<script>
$("#frameDemo").contents().find("img").css("display", "none");
</script>
</body>
</html>
请帮我
亲切的问候 茑集纳
[同源政策](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript) – Antony
是的。这是一个CORS问题,但请用'.hide()替换'.css('display','none')' – jedmao