iframe을 사용하십시오. 업로드가 완료되면 파일 업로드 양식을 iframe에 게시하면됩니다 ($ ('# iframe'). 준비 (...)로이 이벤트를 캡처 할 수 있음). 그러면 동영상 ID를 캡처 할 수 있습니다. 동일한 도메인).
그래서 업로드 양식은 다음과 같은 라인을 따라 될 것입니다 :
<form action="...?nexturl=IFRAME_URL" method="post" enctype="multipart/form-data" target="uploader">
<p>Please select the video you wish to upload to YouTube:</p>
<input type="file" name="file" value="" />
<input type="hidden" name="token" value="" />
<button>Upload</button>
</form>
<iframe id="uploader" name="uploader" style="display: none; width: 1px; height: 1px; border: none;"></iframe>
그리고
다음은 iframe이 (또는 당신이 부모로부터 읽을 수 단지 부모에게 동영상 ID를 통과 할 일은 필요로하는 모든, 하지만 난) 이전을 선호 :
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
<!--
var vars = getVars();
$(document).ready(function()
{
parent.selectVideo(vars[ 'id' ]);
});
function getVars()
{
var vars = [];
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
var hash;
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
-->
</script>
<title></title>
</head>
<body>
</body>
그리고 수행 작업 : D는
그래서 나는이를 넣어 함께 그리고 그것이 완벽하게 작동, 제외하고 내게 비디오 ID를 제공하는 것을 제외하고. parent.selectVideo()가 표시되지만 정확히 어떻게 사용해야하는지 잘 모르겠습니다. 귀하의 답변을 많이 주셔서 감사합니다, 나는 거의 100 % 완성이야! – Tom
업데이트 : Firebug 콘솔을 사용하여 다음 오류가 발생했습니다. parent.selectVideo가 함수가 아닙니다. [Break On This Error] parent.selectVideo (vars [ 'id']); – Tom
알아 냈어 : 부모. $ ("p.youtubeid"). append (document.createTextNode (vars [ 'id'])); – Tom