1
我得到String(u).indexOf()的錯誤,說拒絕訪問HTTP到https ...所以我想這是行不通的。但也許我錯過了一些東西。當src爲https且父節點爲http時,是否可以獲取iframe的url?
這是在同一個域上,只是一個不同的協議。
function process_form(f){
var l = $("iframe#loginFrame");
if(l.length==0){
f.attr("target","loginFrame");
$('<iframe src="/player.htm?ajax=1"'+(!_DBG?' class="hide"':'')+' id="loginFrame" name="loginFrame"></iframe>').prependTo('body');
$("iframe#loginFrame").load(function() {
var u = this.contentWindow.location;
if(String(u).indexOf("confirm")>=0){
change_form(1);
}else if(u!=this.src){
change_form(0);
}
log(u);
log(this.src);
});
}else{
warn("Frame already exists!");
}
change_form(-1);
setTimeout(function(){ f.submit();},500);
log(f);
}