Update fb.js

Code optimization referred to issue #25