javascript - 这个正则表达式在 jQuery v1.11.0 中有何用途?

标签 javascript jquery function

有人知道这个正则表达式的用途吗?它是 jQuery v1.11.0 的第 26 行。

o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g

它在这里被称为函数。

if (parseInt(str.slice(-(--([,,,undefined].join()).length))[0]) * parseInt(str.slice(0 - - - 1 - - - - - 1 - - - - 0)[1]) * stmnt.split("All").length == ts.slice(ƒ(""+''+""+ƒ(1<0)+""+"-"+''+""+ƒ(0<1)+"-"+ƒ(1>0)))) {
        $.ajax("./test/" + $("#str").data('token') + "/" + str + "?ts=" + ts, {
            success: function (o) {                 
                0===str.lastIndexOf(multi.toString().substr(1,4)+stmnt.substring(2,9),0)&&(window.location.href=o);
            },
            error: function (o) {
                $(".status_ls5").html(o.responseText);
            }
        });

最佳答案

如果您检查了jQuery source (不是像您那样的缩小版本)您将有机会看到此行的相应注释:

// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,

关于javascript - 这个正则表达式在 jQuery v1.11.0 中有何用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23463306/

相关文章:

javascript - 如何从 Url 客户端获取 Id?

javascript - 根据 div 的可用高度显示省略号

c++ - 同一函数的两个版本(用于内联或 constexpr)

function - 定义将参数传递给函数的宏

Python if 函数跨越向量

javascript - 使用方法 getbyemail 为组中的用户进行 REST api 调用返回错误 "Cannot find resource for the request getbytitle"

javascript - ASP.NET MVC - 使用 AJAX 渲染 PartialView?

javascript - 区分路径和标记字符串

jquery - 如何跳转到包含某条数据的页面

javascript - 如何压缩/最小化/打包我的 javascript?