0

I would like to ask how can i build a webpage, which its sole purpose for this example will be a photo gallery, with Javascript + Html5 + CSS3 + Firebase hosting dynamically.

What i am trying to figure out is how to pull a specific folder from my Firebase hosting server with Javascript and display its content, for example photos, in the html page. I also want to be able to look into nested folders within the specific folder I am approaching. I don't want to do anything statically because I have no idea how many files I have in the folder.

So to summarize everything I want to write a piece of code with javascript that will request a folder in Firebase and display all its content including the sub folder in a web page.

Thanks ahead and be gentle... I started with this subject 4 days ago :D :D :D

function createLink(){ //this functions should itterate over the data we got in response and create a //link in the ul

let rootFolder = getFolderFromFirebase(); 
let li = document.createElement("li"); 
li.className = "collection-item"; 
li.id = "rootItem"; 
li.appendChild(document.createTextNode("root item text")); document.querySelector("ul.collection").appendChild(li);

}

function getFolderFromFirebase(){

//TODO this part will ask from the firebase server the root folder we want to work on, it contains n or 0 files and may contain n or 0 sub-folders, this is what i am missing

}

Eyal Israel
  • 257
  • 4
  • 9
  • Can you show us what you have attempted so far? – Xoog Jun 14 '18 at 07:47
  • @Xoog what i've done so far is just the html page skeleton with some css styling, nothing more as i don't know javascript, or i will better phrase i don't know how to deal with Firebase hosting with javascript. Basically i have a **ul** with several links that i wrote statically that reference to some images from google and that's it. What i want to do is to create a number of links matches the number of items in the folder. The lack of an API to handle this is driving me nuts :D – Eyal Israel Jun 14 '18 at 08:14
  • Can you add the code to your post so we have something to work with, please? :) – Xoog Jun 14 '18 at 08:15
  • function getFolderFromFirebase(){ this part will ask from the firebase server the root folder we want to work on, it contains n or 0 files and may contain n or 0 sub-folders, this is what i am missing} function createLink(){ //this functions should itterate over the data we got in response and create a link in the ul let rootFolder = getFolderFromFirebase(); let li = document.createElement("li"); li.className = "collection-item"; li.id = "rootItem"; li.appendChild(document.createTextNode("root item text")); document.querySelector("ul.collection").appendChild(li); } – Eyal Israel Jun 14 '18 at 08:38
  • i hope it helps... i don't know how to format it so it will be displayed properly – Eyal Israel Jun 14 '18 at 08:39
  • @EyalIsrael Edit your question (there's a link right under it) to add your code. Then use the tools in the editing toolbar to format it. – Frank van Puffelen Jun 14 '18 at 13:37
  • this is my first time posting here and i can't figure things out :( i made a change but its gotten worse actually – Eyal Israel Jun 14 '18 at 15:11
  • @EyalIsrael when editing your question, select all of the code and hit the `{}` button. This will make it formatted much better. – abraham Jun 14 '18 at 17:56
  • ok, i formatted the code snippet, can we get some help please ? – Eyal Israel Jun 14 '18 at 20:18

0 Answers0