ブラウザで JavaScript が無効になっているかどうかを検出する必要があります。
そのために、ドキュメント内に iframe を配置し、10 秒間隔でページを更新しました。スクリプトを無効にすると、javascript エラー URL を使用して最上位の親をリダイレクトする必要があります。iframe のコードは次のとおりです。
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://localhost/test/" target="_top" />
<noscript>
<meta http-equiv="refresh" content="1; URL=http://localhost/test/javascript_error.php" />
</noscript>
<meta http-equiv="refresh" content="10" />
<title>Detect Script</title>
</head>
<body style="text-align:center;">
Detecting whether javascript script is enabled/disabled in the browser.
</body>
</html>
タグを iframe html のコンテンツとリダイレクト メタ タグに追加しています。これは親の最上位の場所に読み込まれます。
なぜこれがうまくいかないのですか?またはどうすればこのことを機能させることができますか?
ありがとう