2017-01-18 1 views
1

코드가 자동으로 제출되지 않습니다. 내 코드에 무슨 문제가 있습니까? iframe을 통해 원격 웹 사이트에 자동 로그인하려고합니다.코드가 자동으로 제출되지 않습니다.

<form id="login" target="frame" method="post" action="https://remote.com"> 
<input type="hidden" name="username" value="login" /> 
<input type="hidden" name="password" value="pass" /> 
</form> 

<iframe id="frame" name="frame"></iframe> 

<script type="text/javascript"> 
// submit the form into iframe for login into remote site 
document.getElementById('login').submit(); 

// once you're logged in, change the source url (if needed) 
var iframe = document.getElementById('frame'); 
iframe.onload = function() { 
if (iframe.src != "https"//remote.com") { 
    iframe.src = "https://remote.com"; 
} 
} 
</script> 
+0

님 그렇게 안하고 있습니다. – Narf

답변

0

내가 코드를 자동으로

당신이 어떤 링크를 사용하여 자동 여부를 제출 코드를 시도하려는 경우

제출되는 코드를 시도 http가 제출됩니다.

iframe src https 링크에서 허용되지 않는 문제

페이지가 http 인 경우 https 콘텐츠가 포함 된 iframe을 허용합니다.

하지만 페이지가 https이면 http 콘텐츠를 허용하지 않습니다.

다음과 같은 가능성을 제시하십시오.

page - iframe - status 

http - http - allowed 
http - https - allowed 
https- http - not allowed 
https- https - allowed 

참조 ==>Click here

+0

내 페이지가 http이며 https에 액세스하려고합니다. 작동하지 않을 수도 있습니다. – jinggoyestrada

+0

참조 링크 –

+0

에서 볼 수 있습니다. 테스트 할 수있는 http 사이트를 제공 할 수 있습니까? 내 제출? – jinggoyestrada

0

보십시오이

<script> 
$(document).ready(function(){ 
$("#login").submit(); 
}); 

+0

아직 작동하지 않습니다 선생님 : ( – jinggoyestrada

관련 문제