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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.