有2个网站使用jQuery库:
在两个网站上,我发出$ .get请求并传递数组属性ID:
jQuery.get('/my/url', { "ids": [1,2,3] });
在1.10版本上没关系,生成的请求是:
http://domain.com/my/url?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3
但1.7请求看起来像:
http://domain.com/my/url/?ids%255B%255D=1&ids%255B%255D=2&ids%255B%255D=3
如您所见,符号%已替换为%25。 任何想法为什么会发生?
第二个网站中列出了所有包含的JS文件。不幸的是,我无法从生产网站上的此列表中删除任何内容:
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/prototype/prototype.js"></script>
<script type="text/javascript" src="js/lib/ccard.js"></script>
<script type="text/javascript" src="js/prototype/validation.js"></script>
<script type="text/javascript" src="js/scriptaculous/builder.js"></script>
<script type="text/javascript" src="js/scriptaculous/effects.js"></script>
<script type="text/javascript" src="js/scriptaculous/dragdrop.js"></script>
<script type="text/javascript" src="js/scriptaculous/controls.js"></script>
<script type="text/javascript" src="js/scriptaculous/slider.js"></script>
<script type="text/javascript" src="js/varien/js.js"></script>
<script type="text/javascript" src="js/varien/form.js"></script>
<script type="text/javascript" src="js/varien/script.js"></script>
<script type="text/javascript" src="js/varien/menu.js"></script>
<script type="text/javascript" src="js/mage/translate.js"></script>
<script type="text/javascript" src="js/mage/cookies.js"></script>
<script type="text/javascript" src="js/jquery/func.js?v=4"></script>
<script type="text/javascript" src="js/easing/jquery.easing.1.3.min.js"></script>
<script type="text/javascript" src="js/slideshow/jquery.slider.js"></script>
<script type="text/javascript" src="js/slideshow/efects.js"></script>
<script type="text/javascript" src="js/et/currencymanager/et_currencymanager.js"></script>
<script type="text/javascript" src="js/et/currencymanager/et_currencymanager_round.js"></script>
<script type="text/javascript" src="js/es/backcalls/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="js/es/backcalls/jquery.fancybox-1.3.4.pack.js"></script>
答案 0 :(得分:-2)
信不信由你,这两种编码实际上是等价的。百分号(%)的网址编码为%25。
在此处试试:http://meyerweb.com/eric/tools/dencoder/
第二个可能是通过一个函数来编码字符串中的每个字符,而第一个字符很可能被解析为找到字符串中需要首先编码的字符。