在这里工作jsfiddle示例:http://jsfiddle.net/CfJyd/
问题只出现在我知道的Firefox 18中.
以下html:
<div class="test">Test Div</div>
<div class="testIgnore">This should stay the same</div>
Run Code Online (Sandbox Code Playgroud)
有了这个js:
window.addEvent('domready',function() {
$$('.test').set('html','Only Test should update');
});
Run Code Online (Sandbox Code Playgroud)
结果输出:
Only Test should update
Only Test should update
Run Code Online (Sandbox Code Playgroud)
目前升级到Mootools 1.4.5不是一个选项,因为有很多使用1.2.5的插件,有人能指出我正确的方向来获得修复吗?
我在这里找到了答案:https://groups.google.com/forum/#!msg/mootools -users/W7MHwTFHYQ4/BW4HcR951XQYJ
在javascript中的任何地方添加以下代码 - 我将其添加到mootools上方,并且它完美地运行:
String.prototype.contains = function(string, separator){
return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : String(this).indexOf(string) > -1;
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1145 次 |
| 最近记录: |