아래 코드가 (object, Object)를주는 이유는 누구든지 내게 설명 할 수 있습니까?
(console.log (마약)은 JSON.stringify와 JSON.parse 다음에해야 할 것을 제공합니다. 왜 그렇게하고 있는지 말해 준다면 좋을 것입니다.JSON returns (object, Object)
var nombrememes = document.getElementsByClassName("meme").length;
var memenumber = nombrememes + 1;
var newmeme = prompt('Please paste the link of the meme below!');
memes.push ('placememe'+memenumber+'');
var div = document.createElement('div');
document.body.appendChild(div);
div.id = 'placememe'+memenumber+'';
div.className = 'meme';
div.innerHTML = '<img src="'+newmeme+'" width="700" height="700" alt="" />';
var dope = document.getElementById('placememe'+memenumber+'');
console.log(dope);
localStorage.setItem('dope', JSON.stringify(dope));
var pla = JSON.parse(localStorage.getItem('dope'));
alert(pla);
당신이'에 대해 이야기하는 경우 정말 (JSON 객체로)를 보는 방법을 모르기 때문에 그건, 그래서 경고를 시도 –
문자열로 반환 alert' (JSON.stringify (PLA)); –
'alert'는 디버깅 도구가 아닙니다! 'console.log (pla)'를하면 기대 한 것을 볼 수있다. –