encodeURIComponent

Hi Clifton,
One of the problems I have encountered recently involves encodeURIComponent. I use XMLHttpRequest to read files on the server. I thought that the path for the request should be encoded with encodeURIComponent. Maybe this is wrong because it seems that if there is a period in the name of the file to read, encodeURIComponent renders the path illegible.
I have made a small test app that I can send you if necessary. https://www.mediacours.com/programs/testencode The button on the left does not use encodeURIComponent whereas the one on the right does. So, should I be using encodeURIComponent in this case or not, please?
John
One of the problems I have encountered recently involves encodeURIComponent. I use XMLHttpRequest to read files on the server. I thought that the path for the request should be encoded with encodeURIComponent. Maybe this is wrong because it seems that if there is a period in the name of the file to read, encodeURIComponent renders the path illegible.

John