js/app.js
// display local storage elements (parse)
display local storage elements (parse)
display local storage elements ( parse )
function displayTrips(){
    for(let i=0; i<localStorage.length; i++){
        tripDisplayed = JSON.parse(localStorage.getItem(localStorage.key(i)));
        tripDisplayed = new Trip(tripDisplayed.placeName,tripDisplayed.tripPlace,tripDisplayed.transport);
        tripDisplayed.image();
        locationDiv = document.createElement('div');
        locationDiv.setAttribute("class", "locationDiv");
        smallContainer.appendChild(locationDiv);
        locationPic = document.createElement('img');
        locationPic.setAttribute("src", tripDisplayed.pic);
        locationDiv.appendChild(locationPic); 
        infolist = document.createElement('ul');
        infolist.setAttribute('class', 'infoClass'); 
        locationDiv.appendChild(infolist);
        infoOne = document.createElement('li');
        infoOne.textContent= `Place name: ${tripDisplayed.placeName}`; 
        infolist.appendChild(infoOne);
        console.log(infoOne);
        infoTwo = document.createElement('li');
        infoTwo.textContent = `Trip place: ${tripDisplayed.tripPlace}`; 
        infolist.appendChild(infoTwo);
        infoThree = document.createElement('li');
        infoThree.textContent = `Type of transport: ${tripDisplayed.transport}`; 
        infolist.appendChild(infoThree);
    }
}
function displayTrips ( ) { for ( let i = 0 ; i < localStorage . length ; i ++ ) { tripDisplayed = JSON . parse ( localStorage . getItem ( localStorage . key ( i ) ) ) ; tripDisplayed = new Trip ( tripDisplayed . placeName , tripDisplayed . tripPlace , tripDisplayed . transport ) ; tripDisplayed . image ( ) ; locationDiv = document . createElement ( 'div' ) ; locationDiv . setAttribute ( "class" , "locationDiv" ) ; smallContainer . appendChild ( locationDiv ) ; locationPic = document . createElement ( 'img' ) ; locationPic . setAttribute ( "src" , tripDisplayed . pic ) ; locationDiv . appendChild ( locationPic ) ; infolist = document . createElement ( 'ul' ) ; infolist . setAttribute ( 'class' , 'infoClass' ) ; locationDiv . appendChild ( infolist ) ; infoOne = document . createElement ( 'li' ) ; infoOne . textContent = ` ${ tripDisplayed . placeName } ` ; infolist . appendChild ( infoOne ) ; console . log ( infoOne ) ; infoTwo = document . createElement ( 'li' ) ; infoTwo . textContent = ` ${ tripDisplayed . tripPlace } ` ; infolist . appendChild ( infoTwo ) ; infoThree = document . createElement ( 'li' ) ; infoThree . textContent = ` ${ tripDisplayed . transport } ` ; infolist . appendChild ( infoThree ) ; } }
display local storage elements (parse)
display local storage elements ( parse )
//parse from local storage // reinstantiate the object to include the prototype function (image) //display in document