ovde mi nije potrebana nikakva zastita od xss, zato sto su podaci vec provereni.
Kako ovo da izbegnem?
Code:
function insertNewContent(liName,liText) {
insertO = document.getElementById("outputList");
oLi = document.createElement('li');
oSpan = document.createElement('span');
oSpan.setAttribute('class','name');
oName = document.createTextNode(liName+': ');
oText = document.createTextNode(liText);
oSpan.appendChild(oName);
oLi.appendChild(oSpan);
oLi.appendChild(oText);
insertO.insertBefore(oLi, insertO.firstChild);
}
function insertNewContent(liName,liText) {
insertO = document.getElementById("outputList");
oLi = document.createElement('li');
oSpan = document.createElement('span');
oSpan.setAttribute('class','name');
oName = document.createTextNode(liName+': ');
oText = document.createTextNode(liText);
oSpan.appendChild(oName);
oLi.appendChild(oSpan);
oLi.appendChild(oText);
insertO.insertBefore(oLi, insertO.firstChild);
}
[Ovu poruku je menjao Nikola Poša dana 13.03.2015. u 19:23 GMT+1]