爱问知识人 爱问教育 医院库

python如何代替javascript

首页

python如何代替javascript

python如何代替javascript

提交回答
好评回答
  • 2019-06-19 19:31:27
      October 17th, 2008 Encoding is always a problem。 We use the utf8 encoding as a best practise to get around this。  The bad news is, in the web development, the problem gets more complicated。
       Because HTTP, the foundamental protocol the whole internet is built on, doesn’t support non-ascii characters。 In fact, the stupid HTTP can only handle 7-bit characters。
      For the most obvious reason, we invented escape and unescape in client side script。  Nowadays escape()/unescape() is seen in all modern Javascript implementations。
       And they are able to handle different encodings correctly。  For example:escape("记性") will give us "%u8BB0%u6027" and we'll get "记性" back by unescape("%u8BB0%u6027")。
      The above example supposed that the string “记性” is oringally in utf-8 encoding。 It works in IE6/IE7, Firefox, Google Chrome and etc。
       Give it a try!The result of escape is 7-bit characters, that is escaped string can transfer safely through HTTP without any problem。
       There is still problems because most of us don’t write our server in javascript。  unescape() does not exist in any language except javascript of course。
        You may have seen functions or methods with the same or similar name in some library or module。 But as far as I know, none of these functions in the same way as the one does in javascript。
       Can we create one? of course! what is a programmer for?。

    严***

    2019-06-19 19:31:27

类似问题

换一换

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):