function updatealist() {
var thecurrentlist = document.getElementById("sns20170311sa1558updaterlist")
var thesource = document.getElementById("sns20170311sa1558theinput")
var newlistarray = thesource.value.split("\n")
var thenewlistarray = []
for (var i = 0; i < newlistarray.length; i = i + 1) {
var thesymbol = newlistarray[i].split(" ")[0]
var isthisnew = sns20170311sa1558('is this new' + thesymbol)
if (isthisnew === "yes") {
thenewlistarray[thenewlistarray.length] = thesymbol + " new"}}
thecurrentlist.innerHTML = thenewlistarray.join("<br />") + "<br />" + currentlist.innerHTML}
function isthisnew(thesymbol) {
var thecurrentlist = document.getElementById("sns20170311sa1558updaterlist")
var thecurrentlistarray = thecurrentlist.innerHTML.split("<br />")
for (var i = 0; i < thecurrentlistarray.length; i = i + 1) {
var thislisting = thecurrentlistarray[i]
var thischart = thislisting.split(" ")[0]
if (thischart[0] === thesymbol) {return "yes"}}
return "no"}
No comments:
Post a Comment