2011-10-06 3 views
0

Shopify 스토어를 Facebook iframe 앱으로 사용하고있는 인스턴스가 있습니다. 임베디드 https에 문제가 있다는 것을 제외하고는 훌륭하게 작동합니다. 사용자가 일치하지 않는 보안 오류 메시지를 볼 수 없도록 체크 아웃 프로세스를 위해 페이스 북에있을 때만 (전자 상거래 저장소에 직접 접속할 수 있기 때문에) 새 창을 열어야합니다. 나는이 다음을 호출하여 제출 단추의 OnClick 작업을했다 :자바 스크립트 : 양식 대상 변경, 기존 iframe 리디렉션

function changeTarget() { 
    //test to determine if facebook iForm 
    if(location.href != top.location.href){ 
     $("#cartform").attr("target", "_blank"); 
     // **** need to redirect the iframe to the front page of the shopping cart here **** 
    } 
    } 

내가 필요로하는 마지막 부분은 다시 특정 페이지에 iframe을 리디렉션하는 것입니다. 나는 사용자가 구매를 완료하고, 새 창을 닫고, 거기에 앉아있는 카트를보고 싶지 않습니다.

페이스 북은 iframe은 "iframe_canvas"의 ID를 가지고 다음과 같습니다 : 나는 추가 해봤

<iframe class="smart_sizing_iframe" frameborder="0" scrolling="yes" id="iframe_canvas" name="iframe_canvas_fb_https" src='javascript:""' height="600px" style="height: 514px; "></iframe> 

: ...

top.iframe_canvas.location.href="http://foo.org/"; 

self.location.href="http://foo.org/"; 

어느 쪽도 효과가 없었다. 아이디어?

답변

0

self.location.replace(""http://foo.org/") ?