[英]Why does the same single-use regex behave differently in two platforms?
[英]Same code behave differently on two servers
在我的本地主机和一台服务器上可以,数组在$ .each函数内部的控制台中的值与外部相同,但在另一台服务器上,代码的行为不同。 第二个控制台返回空数组,里面是正确的。 服务器如何更改客户端语言行为?
var isChecked = [];
$('.x').each(function() {
if ($(this).prop('checked')) {
id = $(this).prop('id').split('_')[1];
isChecked.push(id);
console.log(isChecked);
} else {
isChecked.splice($.inArray(id, isChecked), 1);
}
});
console.log(isChecked);
标记是:
<table>
<tr class=header>
<td class=first>
<input type="checkbox" id="c">
<label for="c"><span class="tablecheck"></span></label>
</td>
<td class="header" colspan=""><a href="/">User group</a></td>
<td class="header" colspan=""><a href="/">Firstname</a></td>
<td class="header" colspan="2"><a href="/">Lastname</a></td>
</tr>
<tr class="">
<td class=first>
<input type="checkbox" id="x_41" class="x">
<label for="x_41"><span class="tablecheck"></span></label>
</td>
<td>Admin</td>
<td>Firstname</td>
<td>Lastname</td>
</tr>
</table>
服务器如何更改客户端语言行为?
我想您的浏览器已从第二台服务器缓存了旧版本的JavaScript文件,这将解释您为什么会看到不同的行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.