Thursday, October 27, 2016

links code

s<input id="atnbg20161003m1224_s" /><a href="javascript:atnbg20161003m1224()" style="font-size:2em;color:greenyellow">get links</a><div id="atnbg20161003m1224"></div>

<script>

function atnbg20161003m1224() {

var symbol = document.getElementById("atnbg20161003m1224_s").value

var mb = "http://www.marketwatch.com/investing/stock/"
var yb = "http://finance.yahoo.com/quote/"
var fb = "http://elite.finviz.com/quote.ashx?t="

var bases = [fb,yb,mb]
var labels = ["f","y","m"]

function preview(bases,labels,symbol) {
var space = "&nbsp;"; lt = "<"; gt = ">"
var r = link(symbol,bases[0],labels[0],lt,gt) + space + space + space
r = r + link(symbol,bases[1],labels[1],lt,gt) + space + space + space
r = r + link(symbol,bases[2],labels[2],lt,gt); return r}

function code(bases,labels,symbol) {
var space = "&amp;nbsp;"; lt = "&lt;"; gt = "&gt;"
var r = '&lt;br /&gt;' + link(symbol,bases[0],labels[0],lt,gt) + space + space + space
r = r + link(symbol,bases[1],labels[1],lt,gt) + space + space + space
r = r + link(symbol,bases[2],labels[2],lt,gt) + '&lt;br /&gt;'; return r}

function link(symbol,base,label,lt,gt) {
var link = lt + 'a href="' + base + symbol + '" style="font-size:2em;color:burlywood"'
link = link + ' target="_blank"' + gt
link = link + label + lt + '/a' + gt; return link}

var r = preview(bases,labels,symbol) + "<br />" + code(bases,labels,symbol)
document.getElementById("atnbg20161003m1224").innerHTML = r

function au(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l'}
function mu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=m&s=l'}
function wu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=w&s=l'}
function du(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=d&s=l'}
function hu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=i15&s=l'}
function nu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=i3&s=l'}

}

</script>

No comments:

Post a Comment