• Hello all!

    I am having trouble with implementing one WP plugin. This is the plugin site:

    https://www.cryptocompare.com/dev/widget/wizard/?type=1&theme=0&fsym=BTC&tsym=USD&period=1D

    And this is the plugin I have inserted into Custom HTML widget field:

    <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/v1/coin/multi?fsyms=BTC,XRP,ETH,BCH,ADA,LTC,IOT,XEM,DASH,XMR&tsyms=USD,EUR,BTC,CZK';
    s.src = theUrl + ( theUrl.indexOf('?') >= 0 ? '&' : '?') + 'app=' + appName;
    embedder.parentNode.appendChild(s);
    })();
    </script>

    WP gave me a few code errors, so I corrected them, but there is one last error I cant seem to correct, it is baseUrl error:

    
    baseUrl = 'https://widgets.cryptocompare.com/';
    
    var theUrl = baseUrl+'serve/v1/coin/multi?fsyms=BTC,XRP,ETH,BCH,ADA,LTC,IOT,XEM,DASH,XMR&tsyms=USD,EUR,BTC,CZK';

    These two code strings give me this error: “‘baseUrl’ is not defined”

    I suppose WP doesnt know this command and I should replace it with something else, but I am clueless. Searched the web for several hours and no answers anywhere. 🙁 I have also contacted the plugin maker, but its DIY and I dont think they will be able to answer my question.

    Thank you all for help and wish you happy New year! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Are you the same person as https://wordpress.org/support/topic/how-to-add-widger-on-my-wordpress

    If so, please use just one account and one topic for your issue. Thanks.

    Thread Starter miselik

    (@miselik)

    Hello Steve,

    thank you for your reply. I am not the same person as in the link you posted.

    Nevertheless I tried what you suggested. I have again cleaned the errors (except the baseUrl error – I dont know how to solve this), but the widget is still not showing (I supposed it was because of the baseUrl error). Is there anything else I could try? 🙂

    Here you can see that only the widget title is showing up, but not the actuall widget: https://ctrlv.cz/OAXo

    Thank you in advance for your reply

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘‘baseUrl’ is not defined’ is closed to new replies.