Using jQuery prepend() with file include

You’d have to parse the php in the file before it could be appended, so you’d either have to fetch it via AJAX or use wp_localize_script instead to pass some data and build the markup via JavaScript. You might get unpredictable behavior from browsers, since markup outside the body tag violates W3C spec and is not valid. I don’t really see what advantage any of this would have over just using wp_footer(), aside from supporting a handful of poorly coded themes.