我有一个子窗口,其中包含 twitter 共享页面...如何检测 twitter 共享表单是否已提交给 twitter?注意:这是一个子窗口..
因为我想在共享窗口关闭后显示一个警告框
twitter sharing submit detection
var myWindow;
function openTwitterWindow(url){
var width=550;var height=425;var left=parseInt((screen.availWidth/2)-(width/2));
var top=parseInt((screen.availHeight/2)-(height/2));
var windowFeatures="width="+width+",height="+height+",status,resizable,left="+left+",top="+top+"screenX="+left+",screenY="+top;
myWindow=window.open(url,"subWind",windowFeatures);
jQuery('form#update-form').submit(function(){
onWindowClose(myWindow, myCallback);
});
}
function myCallback() {
alert("Your message has been shared. Thank you");
}
function onWindowClose(windowRef,callback, period) {
period = period || 20;
setTimeout(function check() {
if(windowRef == null || windowRef.closed) {
callback();
} else {
setTimeout(check, period);
}
}, period);
}
上面的代码是错误的......我需要帮助
<a style="cursor: pointer" onclick="openTwitterWindow('https://twitter.com/share?url=<?php echo $url; ?>&text= and so on and so forth...