搜索
首页 教育/科学 职业教育

python如何代替javascript

python如何代替javascript

全部回答

2019-06-19

0 0

    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?。
  

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

教育/科学
职业教育
出国/留学
院校信息
人文学科
升学入学
理工学科
外语学习
学习帮助
K12
职业教育
职业教育
远程教育
会计资格考试
司法考试
职业培训
自考
公务员考试
举报
举报原因(必选):
取消确定举报