paste in the old list and click get the old list to load it, then paste in the new list and click get the new list
<div id="sns20170318sa1022o" style="color: goldenrod; font-size: 1.5em;">
</div>
<textarea id="sns20170318sa1022i"></textarea>
<a href="javascript:sns20170318sa1022('get the old list')" style="color: greenyellow; font-size: 1.5em;">get the old list</a>
<a href="javascript:sns20170318sa1022('get the new list')" style="color: greenyellow; font-size: 1.5em;">get the new list</a>
<br />
<div style="color: burlywood; font-size: .75em;">
paste in the old list and click get the old list to load it, then paste in the new list and click get the new list</div>
<div id="sns20170318sa1022n" style="color: violet; font-size: 1.5em;">
</div>
<script>
function sns20170318sa1022(therequest) {
function gettheoldlist() {
var theoldlist = document.getElementById("sns20170318sa1022i")
var theoldliststore = document.getElementById("sns20170318sa1022o")
theoldliststore.innerHTML = theoldlist.value}
if (therequest === "get the old list") {gettheoldlist()}
function getthenewlist() {
var theoldlist = document.getElementById("sns20170318sa1022o")
var thenewlist = document.getElementById("sns20170318sa1022i")
var thenewlistdisplay = document.getElementById("sns20170318sa1022n")
var theoldlistarray = theoldlist.innerHTML.split(",")
var thenewlistarray = thenewlist.split("\n")
function symbol(listing) {return listing.split('","')[0].split('"')[1]}
function isitonthelist(it,thelist) {
for var (i = 0; i < thelist.length; i = i + 1) {
if (thelist[i] === it) {return "yes it is on the list"}}
return "no it is not on the list"}
var thenewsymbols = []
for var (i = 0; i < newlistarray.length; i = i + 1) {
var thesymbol = symbol(thenewlistarray[i])
if (isitonthelist(thesymbol,theoldlistarray) === "yes it is on the list") {thenewsymbols.push(thesymbol)}
} // for
if (thenewsymbols.length === 0) {thenewlistdisplay.innerHTML = "there are no new symbols"}
else {thenewlistdisplay.innerHTML = "there are new symbols: " + thenewsymbols.toString()}
} // get the new list
if (therequest === "get the new list") {getthenewlist()}
} // sns20170318sa1022
</script>
*
No comments:
Post a Comment