2012-07-05 83 views
0

嗨,我想它的內容的iframe調整與JavaScript

frame = document.getElementById(frameId); 
    innerDoc = frame.contentWindow.document; 
    objToResize = (frame.style) ? frame.style : frame; 
    objToResize.height = innerDoc.body.scrollHeight + 10; 

調整大小的iframe但是當iframe是上其他域,我得到

Unsafe JavaScript attempt to access frame 

是否有任何其他方式做到這一點?

+0

可能重複http://stackoverflow.com/questions/5660116/unsafe-javascript-attempt-to-access-frame-in-google -鉻) – antyrat 2012-07-05 10:56:53

回答

0

請參閱以下用於跨域Iframe調整大小的鏈接;

cross-domain-iframe-resizing

[不安全的JavaScript嘗試在谷歌瀏覽器來訪問幀(的