重定向如果没有的JavaScript [英] Redirect if no JavaScript

查看:143
本文介绍了重定向如果没有的JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的情况:

我想用户禁用JavaScript重定向到一个PHP生成的页面(而不是一个AJAX生成的页面)我的Apache服务器上。

I'm trying to redirect users with JavaScript disabled to a PHP generated page (instead of an AJAX generated page) on my Apache server.

我目前使用的:

< NOSCRIPT>
< META HTTP-当量=刷新内容=0; URL = HTTP://mydomain/no_js.php>
< / NOSCRIPT>

有没有办法将用户重定向的页​​面加载之前?

Is there a way to redirect users BEFORE the page loads?

P.S:如果没有,那么任何方式比我目前使用的速度更快?

P.S.: If not then any way faster than the one I'm currently using?

在此先感谢!

推荐答案

如果您需要重定向,使PHP版本的默认,如果启用JavaScript重定向。我想避免这种情况,但并没有一个重定向在所有的,只是基于JavaScript是否启用/禁用显示在同一页面上。您可以显示如启用javascript的项目。我通常有一个类名在页面的正文中没有脚本,如果启动Javascript删除它,你就可以使用CSS来定位的基础上,一个标签显示的内容。

If you need to redirect, make the PHP version the default and redirect if javascript is enabled. I would avoid this though and not have a redirect at all and just display on the same page based on whether javascript is enabled/disabled. You can show the javascript items if enabled. I usually have a class name no-script in the body of the page and remove it if javascript is enabled, you can then use CSS to target what to display based on that one tag.

这篇关于重定向如果没有的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆