工大后院

 找回密码
 加入后院

扫一扫,访问微社区

QQ登录

只需一步,快速开始

搜索
查看: 1704|回复: 5

关于Javascript 问题

[复制链接]
发表于 2008-1-24 23:55 | 显示全部楼层 |阅读模式
有一段javacript如下, 有人知道为何javacript 1.2为何 要另外加一段代码处理吗??谢谢

  1. <script language="Javascript" type="text/javascript"><!-- gVersion="1.0"; //-->
  2. </script>
  3. <script language="Javascript1.1" type="text/javascript"><!-- gVersion="1.1"; //-->
  4. </script>
  5. <script language="Javascript1.2" type="text/javascript"><!-- gVersion="1.2"; var RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g}; //-->
  6. </script>
  7. <script language="Javascript1.3" type="text/javascript"><!-- gVersion="1.3"; //-->
  8. </script>
  9. <script language="Javascript1.4" type="text/javascript"><!-- gVersion="1.4"; //-->
  10. </script>
  11. <script language="Javascript1.5" type="text/javascript"><!-- gVersion="1.5"; //-->
  12. </script>
  13. <noscript>
  14. <img name="dcsimg" width="1" height="1" alt=" " src="http://www1.member-hsbc-group.com/insert_own_entity_dcs_id_here/njs.gif?dcsuri=/nojavascript&WT.js=No" />
  15. </noscript>
复制代码
发表于 2008-1-25 00:37 | 显示全部楼层
没有上下文...RE这个变量是做什么的?
是从什么库里摘出来的?
回复

使用道具 举报

 楼主| 发表于 2008-1-25 01:10 | 显示全部楼层
RE 这个可以看成是正则表达式,负责修改有问题的参数


Regular expression list used to URL encode query parameter values


URL Encoding
Certain characters can cause problems when used in query parameter values.
For example, for a WebTrends query parameter assignment of WT.ti="The Gettysburg Address"; SDC writes the following value to the log file:

&WT.ti=The Gettysburg Address

The space characters in this value cause problems because the space character is used to separate fields within a log file.
The solution is to URL encode all query parameter values.

URL encoding means replacing certain characters with their hexadecimal equivalents of the form %XX where % is the escaping character and XX is the character’s numeric ASCII value.

URL encoded characters are properly rendered in WebTrends reports.

Continuing with this example, the URL-encoded form is as follows:

&WT.ti=The%20Gettysburg%20Address

Note that space characters have been replaced by %20.

The tag URL encodes the following characters: tab, space, #, &, +, ?, ", \, and non-breaking spaces.
These characters are defined in the regular expression list.
The regular expression list contains regular expressions to search for, and the corresponding %XX replacement strings.

Regular expression properties are used as arguments to the string.replace method.

The tag URL encodes parameter values by passing them as arguments into the dcsEscape function.

[ 本帖最后由 smallpig 于 2008-1-25 01:12 编辑 ]
回复

使用道具 举报

 楼主| 发表于 2008-1-25 01:13 | 显示全部楼层
或许我这样问一下,  javacript 1.2  和其他版本之间有什么主要区别吗?? 或者 javacript 1.2 有什么主要缺点??
回复

使用道具 举报

发表于 2008-1-25 14:23 | 显示全部楼层
没留意过这方面 的东西..
基本上都是用1.5了...
就像不大必要考虑IE5及其以下版本一样..

不过也想知道这方面的知识,期待有人回答..
回复

使用道具 举报

发表于 2008-1-25 14:24 | 显示全部楼层
RE是一个JSON OBJECT吧,要看应用才能知道 1.2在这方面的缺点是什么..
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入后院

本版积分规则

QQ|Archiver|手机版|小黑屋|广告业务Q|工大后院 ( 粤ICP备10013660号 )

GMT+8, 2025-8-30 15:10

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表