jScrollPane和jQuery 1.8.0

rgo*_*esf 14 jquery jscrollpane

更新到jQuery 1.8.0后,jScrollPane给了我这个错误:

未捕获错误:语法错误,无法识别的表达式:[type = text/javascript],not([type])

在这一行:

$("script",elem).filter('[type=text/javascript],not([type])').remove();
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?

谢谢

Rob*_*ben 7

  1. not是伪选择器,应该在:用作之前:not()
  2. 按属性名称值过滤时使用selector[attr="value"]- [type="text/javascript"].

所以它应该是 -

.filter('[type="text/javascript"],:not([type])')
Run Code Online (Sandbox Code Playgroud)


Kin*_*ien 5

这是jScrollPane的补丁.使用jquery 1.8.x可以正常工作 https://github.com/jarednorman/jScrollPane/commit/2ef4821afa1dd62db056e3dea737e6f84b17fb13

这是最终的缩小版本:https://raw.github.com/jarednorman/jScrollPane/2ef4821afa1dd62db056e3dea737e6f84b17fb13/script/jquery.jscrollpane.min.js