I understand the conceptual difference between client and server-side scripts but am still a little confused. Here is an example I’m working on that furthers my confusion.
a) I have an XML file stored on the server (in the same directory as my HTML/js files) that I use a jQuery.get() to access and parse the file. The jQuery.get directly names the file to be accessed.
b) Now, I want to create a list of all the filenames in a certain directory on the server. From what I understand I should do this on the client side (I’m using python) then pass the result as an HTTP response (I was planning on creating a json file with python that would be passed to the javascript).
So my confusion lies in the a). It seems like to keep the appropriate server/client differentiation the javascript should just be saying “give me some XML” and my python script should respond with the appropriate file.
But since in example a) javascript is directly accessing a server-side file why cant javascript loop through a directory on the server as well?
Thanks for any insight.
Samir