0
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?

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by SolidSolutions
0

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.

Edited by SolidSolutions: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.