I am working on a web app, and I am creating a user profile page in which I want to load in user information, and display a profile picture. I am using node/express/jade. I have a javascript file that handles what jade view should be loaded when a tab is clicked. For example, if the profile Page tab is clicked, I use jquery post methods to load up data to the user. I want to load up pictures, but I am not sure exactly how the html/or jade form would look like for this, or how I would post the picture from a database using my javascript file.
Should I even use the same javascript file that I am using to post the image? Or Is there another way to load in the image?
I have seen this solution, but I wanted to know if it is possible to do so in the manner described.