document.getElementById('login').innerHTML += '<p><a href = "/<Project name>/<Servlet name>" onclick="sendRequest("/<Project name>/<Servlet name>", "uid=' + FB.getSession().uid + '", AJAXresult, "post")">Recommend me a movie!</a></p>';

The code above works fine outside of the innerHTML.

Is there something wrong with the code above?

It looks like it's the quotes mixed in the string giving the problem. They need to be escaped or better still, set a variable equal to the string you need and then make the innerHTML equal to that variable.