2013-09-06 2 views
0

내 페이지에는 frameOne과 frameTwo라는 두 개의 iframe이 있습니다. frameTwo에서 실행중인 스크립트에서 frameOne을 새로 고치거나 다시로드하려고합니다.어린이의 부모 iframe 다시로드

function reload(){ 
    srcLink = parent.document.getElementById('frameOne').src; 
    parent.document.getElementById('frameOne').src=srcLink; 
} 

이것은 작동하지만 iframe의 초기 값으로 새로 고칩니다. IE : iframe의 src가로드 된 상위 페이지가 'google.com'으로 설정되었지만 (사용자 작업으로 인해) 'yahoo.com'으로 변경되면 내 코드가 해당 페이지를 'google.com'으로 새로 고칩니다. 링크는 페이지가로드 될 때 설정되었습니다. 나는 링크의 변화를 고려하여 그 것을 새로 고침하고 싶습니다.

답변

0

frames[1] (2 iframe 페이지)에서이 시도 :

function changeFrameSrc(becauseURL, changeURL){ 
    var bc = new RegExp(becauseURL, 'i'); 
    if(bc.test(location)){ 
    parent.frames[0].src = changeURL; 
    } 
} 
관련 문제