function jsonFormat(template, json) {  
    return template.replace(//$/{(.+?)/}/g, function ($, $1) {  
        return json[$1];  
        });  
}  
 
 function($,$1)两个参数,而函数体中只能用$1