ITPub博客

首页 > Linux操作系统 > Linux操作系统 > firefox和IE在一个逗号上的差别

firefox和IE在一个逗号上的差别

原创 Linux操作系统 作者:bulletming 时间:2019-06-23 18:21:05 0 删除 编辑
用 YUI ,搞了个datatable的页面,firefox没有问题 ,但是 IE却总是报一个 undefined的错误 。
后来查到下边帖子的错误跟我相同 。FT。我说呢,IE一直Datatable可以显示的 。现在怎么不行了

http://www.nabble.com/YUI-Library-Examples:-DataTable-Control-(beta):-Progressive-Enhancement-td15367359.html

Don't put that last comma in the column definitions and fields arrays.

Instead of ignoring it, IE assumes an extra undefined element in the array,
after the comma, so it reports the length of the array one element longer
than it should, making many loops fail.

Satyam

具体意思就是,像下边这么定义一个数组 ,因为
mysql_datadir之后有个comma,IE就会认为 后边还有一个元素 ,Firefox则不会这样认为 ,从而导致 undefined的错误。
var ds_fields=[
'hostname',
'ip',
'mysql_version',
'mysql_long_query_time',
'mysql_innodb_buffer_pool_size',
'mysql_log_bin',
'mysql_log_slow_queries',
'mysql_innodb_log_file_size',
'mysql_innodb_log_files_in_group',
'mysql_datadir',
];

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/82392/viewspace-327221/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2004-05-31

  • 博文量
    121
  • 访问量
    106597