HELP ME! JS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

HELP ME! JS

all hi, wanted to would ask question, I despite create forum site, but me interestingly, as do so, to polzvatel himself added pictures of the on site, can be whether do this with the help JavaScript? Give a detailed answer please

20th Dec 2019, 1:43 AM
Aslan Kobzhanov
Aslan Kobzhanov - avatar
4 Answers
+ 3
hello Aslan Kobzhanov , your question is bit unclear. next time please make it clear enough so people answering it won't need to play a guessing game. 😊 I guess that you want to add images to your page using JS dynamically. I am also writing code that need 100 images. I'm using JS for it. I have all image links in array . by using a loop I have added all images to html. see how you can fo this. first of all you need to know parent element to which you are going to attach your image. let parent =document.getElementById('parent'); after that you construct a image object with required dimensions. let myimg=new Image(150,150); then add src to image. myimg.src="lorem.jpg"; now you can append this image to parent element. parent.appendChild(myimg); done! Also in case you have to style your image I'll suggest using classList method. https://developer.mozilla.org/en-US/docs/Web/API/Element/classList check this as well : https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image
20th Dec 2019, 2:53 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 1
I want to create a site with anime manga, and I would like users to be able to add their own manga, but I just don’t know how to do it, will I need SQL + PHP?
20th Dec 2019, 11:24 AM
Aslan Kobzhanov
Aslan Kobzhanov - avatar
+ 1
The idea: the user is registered on the site, then if he wants, he can upload his manga to the site, but not through the source code. I hope I conveyed to you my thought)))
20th Dec 2019, 11:27 AM
Aslan Kobzhanov
Aslan Kobzhanov - avatar
0
I want to do as on this site: https: //remanga.org Here the user can add his own images (manga). How can I do the same?)
20th Dec 2019, 11:35 AM
Aslan Kobzhanov
Aslan Kobzhanov - avatar