我想要得到的背景圖片網址.av-video-player-bg
這個iframe中:獲取裏面的iframe元素的CSS屬性與跨域
<iframe src="http://www.gamespot.com/videos/embed/6425430/"></iframe>
我已經試過
$("iframe").contents().find('.av-video-player-bg').css('background-image');
但我得到這個錯誤:
Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin " http://www.gamespot.com " from accessing a cross-origin frame.
你不能,那是同源策略。 – epascarello
@epascarello謝謝 – 01000110