Select any text or image file and click on Upload button. – kschaeffler. First, we will create our external HTML file. 4. You can use the PHP file_get_contents () function that is used to get or read or load file from the given path (Url or Source). Reading and Creating Text Files Using jQuery XML HTTP Request (XHR) mainly serves to retrieve data from a URL without refreshing the page. jQuery provides a function called "getScript", which allows to load external Javascript or js file on the fly.The advantage of using $.getScript is that it loads the content on run time, which is far better than including