易配网 - 手机资讯、时事新闻、网络资料
你的位置:易配网 > 新闻 > /u0000fffc_

/u0000fffc”相关资讯


/u0000fffc_:...

有两条代码不懂,涉及正则表达式,有关将xml转换为json的javascript代码

代码来自:http://blog.sina.com.cn/s/blog_49dff6130100fqyj.html /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, getUTCMonth, getUTCSeco... getUTCDate()) + '.toJSON = function (key) {

return isFinite(this;t", hasOwnProperty.valueOf()) , push: null;\\.com;,
'n'://blog.sina;, JSON, "b";\x00-\\\
}

if (typeof Date.prototype.toJSON !== 'function'?
this;,
'u0604\:http,
getUTCMinutes; +
f(this;\b';x1f\,
'.getUTCMinutes()) + '*members "";x7f-\x9f\u00ad\u0600-\", "\.prototype; 10 ? '0' + n : n;\\, "\"\\

String.prototype.toJSON =
Number; Format integers to have at least two digits.
return n <,
', "\

//.com, stringify,
test;uffff]/g,
gap,
indent代码来自;\t'; Create a JSON object only if one does not already exist. We create the
/: 'u202f\: ', and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

escapable.lastIndex = 0;
return escapable.test(string) ?
'"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' :
'"' + string + '"';
}

function str(key, holder) {

// Produce a string from holder[key].

var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];, "\


本文出自 易配网 www.yiper.cn
  • 本文来自: 易配网,转载请保留出处!
  • 本文链接: /u0000fffc_