help ! - widget has stopped working
  • Hi,

    our widget displaying the current show has suddenly stopped working:
    it's embedded in the sidebar on our wordpress site (hosted by one.com)
    All seems ok to me in the code.

    If anyone has any ideas we would be mighty grateful !

    thanks
    adrian



    <script>
        $(document).ready(function() {
            $("#headerLiveHolder").airtimeLiveInfo({
                sourceDomain: "http://www.radioon.airtime.pro/",
                text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
                updatePeriod: 20 //seconds
            });
        });
    </script>
    <div id="headerLiveHolder" style="border: 5px solid #FF0000; padding: 10px;"></div>
    www.radio-on-berlin.com
  • 18 Comments sorted by
  • Any nasty code in the metadata?
    No longer using Airtime or Libretime.
  • John thanks but in what sense 'nasty code?..it's just embedded in the wp side bar, along with twitter widget, as i said it was working up to a week ago no problem , also our schedule page is down - both linked but no idea why.

    The site is www.radio-on-berlin.com

    thanks for any ideas - 
    adrian


    <audio autoplay="autoplay" controls="controls">
    type="audio/mp3"  />
      Your browser does not support the audio element.
    </audio> 


    <script>
        $(document).ready(function() {
            $("#headerLiveHolder").airtimeLiveInfo({
                sourceDomain: "http://www.radioon.airtime.pro/",
                text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
                updatePeriod: 20 //seconds
            });
        });
    </script>
    <div id="headerLiveHolder" style="border: 5px solid #FF0000; padding: 10px;"></div>



    <a class="twitter-timeline" href="https://twitter.com/radio_on_berlin" data-widget-id="406210556253585410">Tweets by @radio_on_berlin</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>


    www.radio-on-berlin.com
  • Look in your Javascript Error Console..  Ouch!

    Find and sort out the line containing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Probably in index.php or the main template file. You will probably find a stray $ there as well.

    I guess it will then spring back into life.

    Error: SyntaxError: syntax error Source File: http://radioon.airtime.pro/widgets/js/jquery-1.6.1.min.js Line: 1 Source Code:  Error: TypeError: $ is not a function Source File: http://www.radio-on-berlin.com/ Line: 471

    Error: SyntaxError: syntax error Source File: http://radioon.airtime.pro/widgets/js/jquery-ui-1.8.10.custom.min.js Line: 1 Source Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "ht

    Error: TypeError: document.getElementById(...) is null Source File: chrome://web-developer/content/overlay/javascript/overlay.js Line: 7333


    Post edited by John Chewter at 2014-09-21 18:04:28
    No longer using Airtime or Libretime.
  • John, 
    I've looked through the files using the one.com editor but i cannot find the javascript error console.

    Do you mean that there is a stray code $ somewhere in the widgets section ? and if so i could just delete the whole thing and re-build it >?

    thanks

    adrian
    www.radio-on-berlin.com
  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "ht

    The above line is broken. It should look like:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    Maybe you can do a global 'find' for the broken line?

    In Firefox or most other browsers, get the add-in Firebug. Load up your station page and go to Tools/Firebug and look in the ERROR console - ignore WARNINGS at least for now.. My guess is that most or all of that will disappear when the main error is fixed.
    Post edited by John Chewter at 2014-09-21 18:55:18
    No longer using Airtime or Libretime.
  • Thanks again john!

    Will check it out tmrrw.

    Sleep code now !

    Ade
    www.radio-on-berlin.com
  • scanning to no avail / however airtime just informed me that the address has changed recently to :

    www.radio-on-berlin.com
  • still unsure where to replace this,

    it's all this wordpress confusion of multiple files,

    should i put it into the widget area ? though i tried and nothing worked….

    adrian
    www.radio-on-berlin.com
  • Ahh the wonderful world of jQuery and Wordpress ;)

    It's the way the functions ($) are being called, they need to be wrapped in Wordpress like this :

    jQuery(function($) { Your code in here });

    Find the following two calls to the script :

    <script>
        $(document).ready(function() {
            $("#headerLiveHolder").airtimeLiveInfo({
                sourceDomain: "http://radioon.airtime.pro/airtime_web_production/public/widgets/js/jquery.showinfo.js",
                text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
                updatePeriod: 20 //seconds
            });
        });
    </script>

    And

    <script>
        $(document).ready(function() {
           $("#headerLiveTrackHolder").airtimeLiveTrackInfo({
              sourceDomain: "http://radioon.airtime.pro/",
              text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
              updatePeriod: 20 //seconds
           });
        });
    </script>

    And replace them both with these :

    <script>
    jQuery(function($) {
        $(document).ready(function() {
            $("#headerLiveHolder").airtimeLiveInfo({
                sourceDomain: "http://radioon.airtime.pro/airtime_web_production/public/widgets/js/jquery.showinfo.js",
                text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
                updatePeriod: 20 //seconds
            });
        });
    });
    </script>


    <script>
    jQuery(function($) {
        $(document).ready(function() {
           $("#headerLiveTrackHolder").airtimeLiveTrackInfo({
              sourceDomain: "http://radioon.airtime.pro/",
              text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
              updatePeriod: 20 //seconds
           });
        });
    });
    </script>

    It will be working again.

    Ade ;)

    P.S. Personally I like to keep all my scripts really neat and tidy so i'd actually drop them in like this...

    <script>jQuery(function($) { $(document).ready(function() { $("#headerLiveHolder").airtimeLiveInfo({ sourceDomain: "http://radioon.airtime.pro/airtime_web_production/public/widgets/js/jquery.showinfo.js", text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"}, updatePeriod: 20 //seconds });});});</script>

    <script>jQuery(function($) { $(document).ready(function() { $("#headerLiveTrackHolder").airtimeLiveTrackInfo({ sourceDomain: "http://radioon.airtime.pro/", text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"}, updatePeriod: 20 //seconds });});});</script>
    Post edited by Ade Hill at 2014-09-22 18:14:30
  • ade!

    i welcome your coding support:
    I've put this in the widget wordpress panel:
    (pls note the twitter and player are working , but still no program info showing :

    any thoughts ?
    adrian



    <audio autoplay="autoplay" controls="controls">
    type="audio/mp3"  />
      Your browser does not support the audio element.
    </audio> 



    <script>
    jQuery(function($) {
        $(document).ready(function() {
            $("#headerLiveHolder").airtimeLiveInfo({
                text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
                updatePeriod: 20 //seconds

            });
        });
    });
    </script>


    <script>
    jQuery(function($) {
        $(document).ready(function() {
           $("#headerLiveTrackHolder").airtimeLiveTrackInfo({
              sourceDomain: "http://radioon.airtime.pro/",
              text: {onAirNow:"On Air Now", offline:"Offline", current:"Current", next:"Next"},
              updatePeriod: 20 //seconds
           });
        });
    });
    </script>

    <div id="headerLiveTrackHolder" style="border: 1px solid #FF0000; padding: 10px;"></div>





    <a class="twitter-timeline" href="https://twitter.com/radio_on_berlin" data-widget-id="406210556253585410">Tweets by @radio_on_berlin</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    www.radio-on-berlin.com
  • The problem seems to be that the doctype line is mangled - the $ is probably related

    Did you fix it?




    No longer using Airtime or Libretime.
  • <!DOCTYPE html> looks fine to me..

    Can't see why it isn't working...

    Have you checked in Airtime SYSTEM > PREFERENCES and made sure that :

    Allow Remote Websites To Access "Schedule" Info is enabled?
    Post edited by Ade Hill at 2014-09-23 09:41:05
  • I have no idea what you are looking at. Here is your Error Console output. Study it.

    image
    No longer using Airtime or Libretime.
  • Thanks, John

    i found that file in the error report called login.htm
    but i cannot find it on the website server to edit it.

    Is the error on the airtime server?
    or www.radio-on-berlin.com ?

    as i don't have access to the files on
    http//:radioon.airtime.pro/widgets/js/ etc

    adrian
    www.radio-on-berlin.com
  • Call Airtime support is my advice. Its their job ;)


    No longer using Airtime or Libretime.
  • cool thanks !
    www.radio-on-berlin.com
  • ok just been helped by Matt at airtime:
    all is ok now,
    Seems that the addresses were changed for the locations,

    Ive located all the lines and replaced it (some of them took time to find hence the continuing problems)
    Airtime have now changed it back to what it was but luckily this still works !
    Thanks to John and Ade for all your work!
    Adrian-

    here :

    www.radio-on-berlin.com
  • Ahh John I was looking at his website not the scripts server.

    Glad you got it sorted Adrian