为什么此代码在FB App Messenger浏览器(Webview)中不起作用。 父窗口:
<html>
<head>
<script language="Javascript">
function showFBWindow(){
url = "allowfbchild.html"
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
}
</script>
</head>
<body>
<input type="button" OnClick="showFBWindow()" value="Open FB" />
</body>
</html>
子窗口(allowfbchild.html):
<html>
<head>
<script language="Javascript">
function redirectToFB(){
window.opener.location.href="http://wwww.facebook.com";
self.close();
}
</script>
</head>
<body>
Allow the user to view FB
<br/>Are you sure?
<input type="button" value="Ok" OnClick="redirectToFB()" />
</body>
</html>
当单击redirectToFB()按钮时。它不能按编码工作。