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>
나를 도와주세요
종류가 몇 가지 문제가 있습니다 Niao Jina에
[동일 출처 정책] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript) – Antony
예. CORS 문제이지만'.css ('display', 'none')'을'.hide() '로 바꾸십시오. – jedmao