Open kramarmm opened 7 years ago
Hi @kramarmm, let me check it
I replaced '/pictures
' route into '/echo'
and used url.parse
for getting query string data.
And this is my client side code:
$.ajax({
url: "/echo?message=" + lastImageIndex
@kramarmm could you tell me what you want to do ?
I thougth in this way:
1) at first reload send all images of /upload folder put attribute "data-i" for every image send
2) with uploading a new image $ajax will send to server number of last existing image (already uploaded and pasted into html)
The problem was in server responsing. It sent all images every time, even when I already have it.
Now it works, but I'm not sure that it was right desision.
Ok, now I see what you wanted. This is really great approach, although for myself I'd make call to get all images in uploads/ folder :) I'll see how I can help you with this one.
Hello, I have a problem with geting req.body. I leave a comments on this string. Maybe this is a wrong approach?
https://github.com/Artinov/image-gallery-kramarmm/blob/master/public/client.js#L20