zoukankan      html  css  js  c++  java
  • 一个数组的逗号 在IE 和标准浏览器下的差异

    如下数组,标准浏览器不计算最后一个逗号后面的个数

    而在IE下,length却多了1  因为它把逗号后面的空元素也认为是一元素

    一个小逗号 耽误了半天时间~~ 

    [ { "pid":"31", "title":"", "url":"http://pic.qslimg.com/album/2a/b7/thumb_b_201012311133183403.jpg", "view":84, "time":"2010-12-31 11:33" }, { "pid":"30", "title":"", "url":"http://pic.qslimg.com/album/e8/2d/thumb_b_201012311133177037.jpg", "view":88, "time":"2010-12-31 11:33" }, { "pid":"29", "title":"", "url":"http://pic.qslimg.com/album/c9/40/thumb_b_201012311133167546.jpg", "view":26, "time":"2010-12-31 11:33" }, { "pid":"27", "title":"", "url":"http://pic.qslimg.com/album/29/3b/thumb_b_201012311133157005.jpg", "view":13, "time":"2010-12-31 11:33" }, { "pid":"26", "title":"", "url":"http://pic.qslimg.com/album/c8/f6/thumb_b_201012311133146554.jpg", "view":11, "time":"2010-12-31 11:33" }, { "pid":"25", "title":"", "url":"http://pic.qslimg.com/album/29/72/thumb_b_201012311133147746.jpg", "view":9, "time":"2010-12-31 11:33" }, { "pid":"24", "title":"", "url":"http://pic.qslimg.com/album/9b/36/thumb_b_201012311133139930.jpg", "view":10, "time":"2010-12-31 11:33" }, { "pid":"23", "title":"", "url":"http://pic.qslimg.com/album/86/33/thumb_b_201012311133134539.jpg", "view":7, "time":"2010-12-31 11:33" }, { "pid":"22", "title":"", "url":"http://pic.qslimg.com/album/ba/60/thumb_b_201012311133127631.jpg", "view":4, "time":"2010-12-31 11:33" }, { "pid":"21", "title":"", "url":"http://pic.qslimg.com/album/ab/fd/thumb_b_201012311133126524.jpg", "view":3, "time":"2010-12-31 11:33" }, { "pid":"20", "title":"", "url":"http://pic.qslimg.com/album/c4/d0/thumb_b_201012311133117456.jpg", "view":2, "time":"2010-12-31 11:33" }, { "pid":"19", "title":"", "url":"http://pic.qslimg.com/album/fe/f6/thumb_b_201012311133119636.jpg", "view":2, "time":"2010-12-31 11:33" }, { "pid":"18", "title":"", "url":"http://pic.qslimg.com/album/28/92/thumb_b_201012311133106546.jpg", "view":2, "time":"2010-12-31 11:33" }, { "pid":"17", "title":"", "url":"http://pic.qslimg.com/album/31/b4/thumb_b_201012311133101359.jpg", "view":3, "time":"2010-12-31 11:33" }, { "pid":"16", "title":"", "url":"http://pic.qslimg.com/album/66/82/thumb_b_201012311133096153.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"15", "title":"", "url":"http://pic.qslimg.com/album/19/50/thumb_b_201012311133082352.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"14", "title":"", "url":"http://pic.qslimg.com/album/0e/40/thumb_b_201012311133066957.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"13", "title":"", "url":"http://pic.qslimg.com/album/17/df/thumb_b_201012311133055386.jpg", "view":1, "time":"2010-12-31 11:33" }, { "pid":"12", "title":"", "url":"http://pic.qslimg.com/album/5c/38/thumb_b_201012311133047517.jpg", "view":1, "time":"2010-12-31 11:33" }, { "pid":"11", "title":"", "url":"http://pic.qslimg.com/album/7e/f0/thumb_b_201012311133045140.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"10", "title":"", "url":"http://pic.qslimg.com/album/f8/66/thumb_b_201012311133031311.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"9", "title":"", "url":"http://pic.qslimg.com/album/96/76/thumb_b_201012311133026346.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"8", "title":"", "url":"http://pic.qslimg.com/album/fc/21/thumb_b_201012311133013825.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"7", "title":"", "url":"http://pic.qslimg.com/album/cc/33/thumb_b_201012311133005762.jpg", "view":1, "time":"2010-12-31 11:33" }, { "pid":"6", "title":"", "url":"http://pic.qslimg.com/album/ed/52/thumb_b_201012311132596306.jpg", "view":0, "time":"2010-12-31 11:33" }, { "pid":"5", "title":"", "url":"http://pic.qslimg.com/album/01/a3/thumb_b_201012311132596511.jpg", "view":0, "time":"2010-12-31 11:32" }, { "pid":"4", "title":"", "url":"http://pic.qslimg.com/album/19/14/thumb_b_201012311132584547.jpg", "view":0, "time":"2010-12-31 11:32" }, { "pid":"3", "title":"", "url":"http://pic.qslimg.com/album/66/c3/thumb_b_201012311132576242.jpg", "view":0, "time":"2010-12-31 11:32" }, { "pid":"2", "title":"", "url":"http://pic.qslimg.com/album/43/1d/thumb_b_201012311132578308.jpg", "view":0, "time":"2010-12-31 11:32" }, ];

  • 相关阅读:
    在winform下实现左右布局多窗口界面的方法(一)
    C# 使用API检查域用户名和密码是否正确
    C#检查网络是否可以连接互联网
    总结:实体类和(XML或二进制)之间相互转(序列化和反序列化)
    XML和实体类之间相互转换(序列化和反序列化)
    C# XML反序列化与序列化举例:XmlSerializer
    XML文件与实体类的互相转换
    Message类的属性Msg所关联的消息ID
    C# Message 消息处理
    在.net中读写config文件的各种方法(自定义config节点)
  • 原文地址:https://www.cnblogs.com/trance/p/1925702.html
Copyright © 2011-2022 走看看