隐藏旧版浏览器的Java代码 [英] Hide Javascript Code to Older Browser

查看:74
本文介绍了隐藏旧版浏览器的Java代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我认为这有点愚蠢,但是,我想知道是否有任何方法可以在较旧的浏览器中隐藏Javascript代码,而又不影响现代浏览器的代码.

Well I think this is kinda dumb but, I wonder if there's any way to hide Javascript code from older browsers without affecting the code for modern browsers.

是的,我知道有<noscript></noscript>标记可为较旧的浏览器显示一条消息,但是有时如果某些旧版本的浏览器由于无法识别而将JS代码显示为文本.

Yes I know there's the <noscript></noscript> tag to show a message for older browsers, but sometimes very old browsers for any reason show the JS code as text if is not recognized.

希望您能理解

推荐答案

<script>
<!--
    Your code here
//-->
</script>

这篇关于隐藏旧版浏览器的Java代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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