facebook.js
connect: function (formElement, requiredPerms) { add document.body.appendChild(formElement); if (this.ithing) { return formElement.submit(); }
when we use ajax 'formElement' no exists for js
this line may help:
add document.body.appendChild(formElement);