Your replace (fb.replace('/', '\\/')) is correct (if you only want to replace the first one). It's just that whatever console you're using is showing you the string in string literal format, and in a string literal, to actually have a \ in a string, you have to escape it (with another \). Your replaced string actually only has one \ in it, it's just how the console is displaying it to you.
Gratuitous example:
var fb = 'foo / bar';
fb = fb.replace('/', '\\/');
var pre = document.createElement('pre');
pre.appendChild(
document.createTextNode(fb)
);
document.body.appendChild(pre);
If you want to replace all / in the string (if there were more than one):
var fb = "foo / bar";
fb = fb.replace(/\//g, "\\/");
console.log('foo / bar'.replace('/', '\\/'))