检测Javascript可用性... [英] Detecting Javascript availability...

查看:69
本文介绍了检测Javascript可用性...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有这个网络应用程序,需要在UA中启用Javascript才能启用
(这对我们的客户来说没问题)。


现在我想做一个预先在登录屏幕之前的页面,

通知用户他/她必须打开JS。


问题是我更愿意只显示此页面如果

JS没有开启。 (因此,我有一个鸡/蛋问题)。


如果需要,我们可以要求IE仅作为UA。


关于thisone的任何提示,建议或评论?


TIA ...


-

Dag 。

解决方案

> Dag Sunde < me@dagsunde.com>写道:

新闻:7L ****************** @ juliett.dax.net ....

我们有这个网络应用程序,需要在UA中启用Javascript(这是我们的客户可以做到的)。

现在我想做一个预先在登录屏幕之前的页面,
告知用户他/她必须打开JS。

问题是,我希望仅在
JS isn'时显示此页面不上。 (因此,我有一个鸡/蛋问题)。

如果需要,我们可以要求IE只作为UA。

任何指针,建议或评论在这个人身上?

TIA ...




<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 Transitional / / EN">

< html>

< head>

< title>

Check JavaScript

< / title>

< / head>

< body>

< script type =" text / javascript">

函数proceed(){

document.location.href ='''http://www.download.com''

}

onload =继续

< / script>

< noscript>

< h1 style =" color:red; text-align:center;">

必须启用JavaScript

< / h1>

< p>

或许有关如何启用javascript的方向

< / p>

< / NOSCRIPT> ;

< / body>

-

BootNic 2005年6月21日星期二上午8:50

幽默只是对抗宇宙的另一种防御。

*梅尔布鲁克斯*


" BootNic" <博***** @ bounce.prodigy.net>在消息中写道

新闻:K2 **************** @ newssvr33.news.prodigy.com ...

< blockquote class =post_quotes>Dag Sunde < me@dagsunde.com>写道:
新闻:7L ****************** @ juliett.dax.net ....

我们有这个网站 - 需要在UA中启用Javascript的应用程序(我们的客户可以这样做)。

现在我想制作一个预先的应用程序。在登录屏幕之前的页面,
通知用户他/她必须打开JS。


< snipped />

<!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN">
< html>
< head>
< title>
检查JavaScript
< / title>
< / head>
< body>
< script type =" text / javascript">
function proceed() {
document.location.href =''http://www.download.com''
}
onload =继续
< / script>
< ; noscript>
< h1 style =" color:red; text-align:center;">
必须启用JavaScript
< / h1>
< ; p>
或许有关如何启用javascript的方向
< / p>
< / noscript>
< / body>




非常感谢!


我现在意识到< noscript>标签一直支持

到xhtml严格,一切都很好。


-

Dag。


Dag Sunde写道:

" BootNic" <博***** @ bounce.prodigy.net>在消息中写道
新闻:K2 **************** @ newssvr33.news.prodigy.com ......

< blockquote class =post_quotes>Dag Sunde < me@dagsunde.com>写道:
新闻:7L ****************** @ juliett.dax.net ....

我们有这个网站 - 需要在UA中启用Javascript的应用程序(我们的客户可以这样做)。

现在我想制作一个预先的应用程序。在登录屏幕之前的页面,
通知用户他/她必须打开JS。



< snipped />
< blockquote class =post_quotes><!DOCTYPE html PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN">
< html>
< head>
< title>
检查JavaScript
< / title>
< / head>
< body>
< script type =" text / javascript">
函数proceed(){
document.location.href =''http://www.download.com''
}
onload = proceed
< / script>
< noscript>
< h1 style =" color:red; text-align:center;">
必须启用JavaScript
< / h1>
< p>
或许有关如何启用javascript的方向
< / p>
< / noscript>
< ; / body>



非常感谢!

我现在意识到< noscript>标签一直支持
到xhtml严格,一切都很好。




不如你想象的那么好,它的问题也很重要。


将noscript部分留在页面本身。如果脚本不是
可用(无论是在UA还是禁用),那么该页面将不会被重定向,并且用户将会看到它。然后,是否支持

noscript无关紧要。


-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &安培;新闻组每周

答:它会破坏对话的顺序

问题:为什么?

答案:热门发布。

问题:Usenet上最烦人的事情是什么?


We have this web-app that requires Javascript to
be enabled in the UA (this is okay''ed by our customer).

Now I want to make a "pre" page before the login screen,
informing the user that he/she must have JS turned on.

Problem is that I would prefer to show this page only if
JS isn''t on. (and hence, I have a "Chicken/Egg" problem).

If neccessary, we can require IE-only as UA.

Any pointers, suggestions or comments on thisone?

TIA...

--
Dag.

解决方案

> "Dag Sunde" <me@dagsunde.com> wrote:

news:7L******************@juliett.dax.net....

We have this web-app that requires Javascript to
be enabled in the UA (this is okay''ed by our customer).

Now I want to make a "pre" page before the login screen,
informing the user that he/she must have JS turned on.

Problem is that I would prefer to show this page only if
JS isn''t on. (and hence, I have a "Chicken/Egg" problem).

If neccessary, we can require IE-only as UA.

Any pointers, suggestions or comments on thisone?

TIA...



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Check JavaScript
</title>
</head>
<body>
<script type="text/javascript">
function proceed(){
document.location.href = ''http://www.download.com''
}
onload = proceed
</script>
<noscript>
<h1 style="color:red;text-align:center;">
JavaScript must be enabled
</h1>
<p>
perhaps some direction on how to enable javascript
</p>
</noscript>
</body>
--
BootNic Tuesday, June 21, 2005 8:50 AM

Humor is just another defense against the universe.
*Mel Brooks*


"BootNic" <Bo*****@bounce.prodigy.net> wrote in message
news:K2****************@newssvr33.news.prodigy.com ...

"Dag Sunde" <me@dagsunde.com> wrote:
news:7L******************@juliett.dax.net....

We have this web-app that requires Javascript to
be enabled in the UA (this is okay''ed by our customer).

Now I want to make a "pre" page before the login screen,
informing the user that he/she must have JS turned on.

<snipped/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Check JavaScript
</title>
</head>
<body>
<script type="text/javascript">
function proceed(){
document.location.href = ''http://www.download.com''
}
onload = proceed
</script>
<noscript>
<h1 style="color:red;text-align:center;">
JavaScript must be enabled
</h1>
<p>
perhaps some direction on how to enable javascript
</p>
</noscript>
</body>



Thanks a lot!

I now realize that the <noscript> tag is supported all the way
to xhtml strict, and all is well.

--
Dag.


Dag Sunde wrote:

"BootNic" <Bo*****@bounce.prodigy.net> wrote in message
news:K2****************@newssvr33.news.prodigy.com ...

"Dag Sunde" <me@dagsunde.com> wrote:
news:7L******************@juliett.dax.net....

We have this web-app that requires Javascript to
be enabled in the UA (this is okay''ed by our customer).

Now I want to make a "pre" page before the login screen,
informing the user that he/she must have JS turned on.



<snipped/>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
Check JavaScript
</title>
</head>
<body>
<script type="text/javascript">
function proceed(){
document.location.href = ''http://www.download.com''
}
onload = proceed
</script>
<noscript>
<h1 style="color:red;text-align:center;">
JavaScript must be enabled
</h1>
<p>
perhaps some direction on how to enable javascript
</p>
</noscript>
</body>


Thanks a lot!

I now realize that the <noscript> tag is supported all the way
to xhtml strict, and all is well.



Not as well as you think, and its material to your question.

Leave the noscript section in the page itself. If script is not
available (whether not in the UA or disabled) then the page won''t be
redirected and the user will see it. Then, it doesn''t matter whether
noscript is supported or not.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?


这篇关于检测Javascript可用性...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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