Jump to content

Code Help


Sue Busher

Recommended Posts

I am trying to embed this code into Frog but it is having none of it. What am I missing?

<div data-tockify-component="calendar" data-tockify-calendar="events.kennet"></div>
<script data-cfasync="false" data-tockify-script="embed" src="https://public.tockify.com/browser/embed.js"></script>

 

Link to comment
Share on other sites

Try this....

<div data-tockify-component="calendar" data-tockify-calendar="events.kennet"></div>

<script>
$.getScript( "https://public.tockify.com/browser/embed.js" )
  .done(function( script, textStatus ) {
    console.log( textStatus );
  })
  .fail(function( jqxhr, settings, exception ) {
    console.log( "There has been an error" );
});
</script>

 

  • Thanks 1
Link to comment
Share on other sites

While you are on fixing embedded stuff @pconkie  This code loads when you first open the site...  but not if you close and reopen!!  Its the weather in Berlin!!   Nice little embedded widget if we can get it working all the time ;)

<a class="weatherwidget-io" href="https://forecast7.com/en/52d5213d40/berlin/" data-label_1="BERLIN" data-label_2="WEATHER" data-font="Verdana" data-icons="Climacons Animated" data-mode="Forecast" data-days="3" data-theme="weather_one" >BERLIN WEATHER</a>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://weatherwidget.io/js/widget.min.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','weatherwidget-io-js');
</script>

 

Weather1.fw.png

Weather2.fw.png

@Graham Quince an update for the Frog On Tour Template site!!! ;) 

Link to comment
Share on other sites

You'll need to do more testing, but I think this refreshes the weather widget every time the site is opened.

<a class="weatherwidget-io" href="https://forecast7.com/en/52d5213d40/berlin/" data-label_1="BERLIN" data-label_2="WEATHER" data-font="Verdana" data-icons="Climacons Animated" data-mode="Forecast" data-days="3" data-theme="weather_one" >BERLIN WEATHER</a>

<script>
  $.getScript( "https://weatherwidget.io/js/widget.min.js");
</script>

 

  • Thanks 2
Link to comment
Share on other sites

27 minutes ago, pconkie said:

You'll need to do more testing, but I think this refreshes the weather widget every time the site is opened.


<a class="weatherwidget-io" href="https://forecast7.com/en/52d5213d40/berlin/" data-label_1="BERLIN" data-label_2="WEATHER" data-font="Verdana" data-icons="Climacons Animated" data-mode="Forecast" data-days="3" data-theme="weather_one" >BERLIN WEATHER</a>

<script>
  $.getScript( "https://weatherwidget.io/js/widget.min.js");
</script>

 

He shoots....  he scores!! :D

Link to comment
Share on other sites

Hi @Sue Busher

This is your code:

<div data-tockify-component="calendar" data-tockify-calendar="events.kennet"></div>
<script data-cfasync="false" data-tockify-script="embed" src="https://public.tockify.com/browser/embed.js"></script>

I didn't change anything on the first line.  I replaced your second line with a new block of code

<script>
$.getScript( "https://public.tockify.com/browser/embed.js" )
  .done(function( script, textStatus ) {
    console.log( textStatus );
  })
  .fail(function( jqxhr, settings, exception ) {
    console.log( "There has been an error" );
});
</script>

Which you could boil down to this new line if you prefer....

<script>$.getScript( "https://public.tockify.com/browser/embed.js" )</script>

If you are going to embed several views, this approach is going to need more testing before you plunge in and get a subscription!

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

@pconkie

 

I am so sorry to ask again, but we were given a bit more code and I can't seem to get it to display again. Would you mind working your magic once again - I promise I will try not to bother you again.

 

<div data-tockify-component="calendar" data-tockify-calendar="kennet" data-tockify-tags="fixture"
    data-tockify-canonicalHost="https://events.kennetschool.co.uk"></div>
 
<script>
$.getScript( "https://public.tockify.com/browser/embed.js" )
  .done(function( script, textStatus ) {
    console.log( textStatus );
  })
  .fail(function( jqxhr, settings, exception ) {
    console.log( "There has been an error" );
});
</script>
 

Link to comment
Share on other sites

3 hours ago, Sue Busher said:

I am so sorry to ask again, but we were given a bit more code and I can't seem to get it to display again. Would you mind working your magic once again - I promise I will try not to bother you again.
 

@Sue Busher the code you posted works for me on a new site, so its not the code that's the problem.

which site /page have you tried this on?

 

Link to comment
Share on other sites

@Simon Law

Me again, sorry Simon, I have embedded the code on a number of pages within our new website (Kennet School - not live yet). The code is slightly different on different pages as I am telling it to show only events relevantly tagged for that page. However, the first time I visit the page, I see the calendar. When I go to another page on the site, it doesn't appear. If I log out and back in, go to the page it didn't appear on, it appears, but then when I go to another page with the code on it doesn't,

Any ideas why this would happen? It is happening in both Chrome and IE.

Link to comment
Share on other sites

@Sue Busher

There is something at the tockify end that is listening for requests. Tockify hears fine when a site is first opened in frog but not again after that (unless frog is closed down completely and re-opened). I think this is similar to the issues with multiple twitter embeds documented on this forum and so I thought the solution for twitter might work for tockify.  However after an hour or so  haven't made much progress.

Looking at what the tockify embed javascript actually does behind the scenes, I'm wondering if we can just ditch it all together! 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...