update jquery.autoRefresh.js to optimize code