I am following the logic outlined in this example.
The code works when I run this in regular JavaScript. However, when placed in React, it doesn't.
stonktank:function myRun(json){
document.getElementById('sting').innerHTML = json.Symbol;
var stockscript = document.createElement('script');
stockscript.src = 'http://dev.markitondemand.com/MODApis/Api/v2/Quote/jsonp?symbol=AAPL&callback=myRun';
document.getElementsByTagName('head')[0].appendChild(stockscript);
},
The error I get is myRun
is not defined.