Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a asp.net solution which consist of an image folder with a couple of images. I need to create a pop up to view, upload, delete the images in this folder. I dont want to use any html file all these should be done in a js javascript file

What I have tried:

window.addEventListener('click', function (evt) {
if (evt.detail === 2) {
var myWindow = window.open("", "MsgWindow", "width=400, height=400");
myWindow.document.write("");
}
});
Posted
Updated 8-Mar-16 7:38am
Comments
So inject html into it.
Nathan Minier 7-Mar-16 7:14am    
Embedding HTML into JavaScript string literals makes actual upkeep very, very difficult. As a person who regularly performs maintenance on other people's code I beg you: use a separate HTML file as a template, preferably tucked into a folder named something like "Templates", and ideally with a sensible file name, like "FileManager.html".
ZurdoDev 7-Mar-16 7:52am    
You have to have an html file. That is what the user sees. So, what exactly are you asking?
Member 11116644 7-Mar-16 7:54am    
I want the html to be embedded inside my js file...so that no one will come to know that this kind of a feature exist in the solution
ZurdoDev 7-Mar-16 8:05am    
But a user cannot browse to a JS file.

Regardless, you'll just have to build all the html dynamically. Sounds like a bad idea but if you must, go for it.

1 solution

You can't do this with javascript or jquery, because these languages are designed to run on client side. To upload a file you need write access to the server's filesystem. Therefore you need a server-side language like PHP, CGI and so on.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900