简单的说,SourceMap是为了压缩后的代码的调试提供方便。 比如:你在项目中引用了jquery.min.js(压缩后的代码),当有个js错误,我们通过控制台显示是第一行出差了,然而第一行有上万个字符,但是,浏览器的错误提示就是在第一行错了,晕,鬼知道第一行哪里错了,这种错误提示就是无意义的了。 纵使,你费了九牛二虎之力,找到错误端,比如:
getJSON:function(e,t,n){return b.get(e,t,n,"json")}...
Chrome(版本 25.0.1364.172 m)下的console对象的方法有:
memory
profiles
_commandLineAPI
debug
error
info
log
warn
dir
dirxml
trace
assert
count
markTimeline
profile
profileEnd
time
timeEnd
timeStamp
group
groupCollapsed
groupEnd
clear
...