AJAX function not working [closed]

You have an error on this line: var appendHTML = '<div class="ajax-loading-screen appended"> Be careful with multi-line string in Javascript. It doesn’t work the way it does in PHP.

https://stackoverflow.com/questions/805107/how-to-create-multiline-strings