在新窗口中打开HTML元重定向

Jer*_*son 2 html

我需要通过HTML元网重定向网页并在新窗口中打开该页面.我怎样才能做到这一点?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Photo Gallery Redirect</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <meta http-equiv="Refresh" content="0; url=http://google.com">
    </head>
    <body>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Phi*_*son 12

你可以这样做!当在iframe(例如Facebook应用程序画布页面)中运行刷新并且您希望刷新将内容加载到主(父)窗口时,它尤其有用.

在元重定向中使用以下Javascript:

<meta http-equiv="refresh" content="5; URL=javascript:window.open('http://google.com','_parent');">
Run Code Online (Sandbox Code Playgroud)