【发布时间】:2013-07-03 14:20:02
【问题描述】:
我尝试更改 iframe 中内容的 css。
即我需要隐藏 <img> 元素。
但是我改不了。。
这是示例代码:
<!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>
请帮帮我
亲切的问候 鸟吉娜
【问题讨论】:
-
是的。这是一个 CORS 问题,但请务必将
.css('display', 'none')替换为.hide()