Javascript not working
-
Hello,
for a client i need to display a current cryptocurrency prices in a table, so i need to put this widget in the tablepress
<script type=”text/javascript”>
baseUrl = “https://widgets.cryptocompare.com/”;
var scripts = document.getElementsByTagName(“script”);
var embedder = scripts[ scripts.length – 1 ];
(function (){
var appName = encodeURIComponent(window.location.hostname);
if(appName==””){appName=”local”;}
var s = document.createElement(“script”);
s.type = “text/javascript”;
s.async = true;
var theUrl = baseUrl+’serve/v3/coin/header?fsyms=BTC&tsyms=USD’;
s.src = theUrl + ( theUrl.indexOf(“?”) >= 0 ? “&” : “?”) + “app=” + appName;
embedder.parentNode.appendChild(s);
})();
</script>Unfortunately, it’s not working. I tested other widgets too and they display perfectly, but i need this one.
I’m using “[table id=1? responsive=flip convert_line_breaks=false /]” to display the table.
Thank you so much for your help in advance!
Martina Du?ková
- The topic ‘Javascript not working’ is closed to new replies.