<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/scripts/libs/jquery-1.7.1.min.js"><\/script>')</script>
<script type="text/javascript" src="//use.typekit.net/ewa5pge.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script>
$(document).ready(function() {
var $ticker = $('#ticker');
if ($ticker.length == 1) {
var tickerStatement = 'select '+$ticker.attr('data-pricefield')+', Change from yahoo.finance.quotes where symbol in ("'+$ticker.attr('data-symbol')+'")';
var yqlQuery = $.ajax({
url: "http://query.yahooapis.com/v1/public/yql",
dataType: "jsonp",
data: {
q: tickerStatement,
format: "json",
env: 'store://datatables.org/alltableswithkeys'
// callback: "?"
}
});
yqlQuery.success(function(response) {
var quote = response.query.results.quote;
var changeDirection = 'change-none';
if (quote.Change > 0) {
changeDirection = 'change-increase';
} else if (quote.Change < 0) {
changeDirection = 'change-decrease';
} else {
quote.Change = '— No change';
}
$('#ticker-price').html(quote[$ticker.attr('data-pricefield')]);
$('#ticker-change').html(quote.Change).addClass(changeDirection);
$('#ticker').removeClass('hidden');
});
}
});
</script>
This is the code on page:
<div id="ticker-outer">
<a href="http://www.asx.com.au/asx/research/companyInfo.do?by=asxCode&asxCode=SPZ" target="_blank" class="png" id="ticker" data-symbol="SPZ.AX" data-pricefield="PreviousClose">
<span id="ticker-top-text">SPZ: <strong>$AU</strong></span>
<strong><span id="ticker-price"></span></strong>
<span id="ticker-change" class="change-none"></span>
<span id="ticker-change-checked">as of last close</span>
</a>
</div>
Any help would be greatly appreciated as the site has just gone live with a dodgy ticker!!!
Many thanks,
Deb