function getJsonData(attr,val) { $.ajaxSettings.async = false;//必须加的,若不加返回的是"" var ret; $.getJSON('http://localhost:8008/js/modules/jobInterface/shareFiles/data.json', function(rollback){ ret= rollback[attr][val]; }); return ret;}