Thursday, January 12, 2017

2chartsetcode

<span style="color:burlywood">record: </span><input id="atnbg20170112th0901i" />A href="javascript:atnbg20170112th0901getthecode()" style="font-size:2em;color:greenyellow">get the code</a><br /><div id="atnbg20170112th0901preview"></div><div id="atnbg20170112th0901thecode" style="color:burlywood"></div>

<script>

function getthecode() {
var therecord = document.getElementById("atnbg20170112th0901i").value
var thesymbol = therecord.split("/")[therecord.split("/").length + 1].split("c")[0]
var thepreview = document.getElementById("atnbg20170112th0901preview")
var thecode = document.getElementById("atnbg20170112th0901thecode")

// http://elite.finviz.com/publish/011217/EGLEccdl11200923.png
// http://elite.finviz.com/chart.ashx?t=EGLE&ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l

var p = '<img src="http://elite.finviz.com/publish/011217/'
p = p + thesymbol + 'ccdl11200923.png" style="width:100px" />'
p = p + '<img src="http://elite.finviz.com/chart.ashx?t=' + thesymbol
p = p + '&ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l" />'
p = p + '&nbsp;&nbsp;&nbsp;<a href="http://elite.finviz.com/quote.ashx?t=' + the symbol
p = p + '" style="font-size:2em;color:burlywood" target="_blank">f</a>'

var c = '&lt;img src="http://elite.finviz.com/publish/011217/'
c = c + thesymbol + 'ccdl11200923.png" style="width:100px" /&gt;'
c = c + '&lt;img src="http://elite.finviz.com/chart.ashx?t=' + thesymbol
c = c + '&ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l" /&gt;'
c = c + '&nbsp;&nbsp;&nbsp;&lt;a href="http://elite.finviz.com/quote.ashx?t=' + the symbol
c = c + '" style="font-size:2em;color:burlywood" target="_blank">f&lt;/a&gt;'

thepreview.innerHTML = p;thecode.innerHTML = c}

</script>

No comments:

Post a Comment