Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

Embed content (HTML+JS) only shown on 2nd viewing 8 years 7 months ago #3620

  • Susanne
  • Susanne's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
I've added an embded content page, on which I've put my HTML+JS. For the sake of the example, let's say I've put it on page 3. Now, when I do the following:
- play project
- step to page 2
- click on arrow to go to next page
Now, the counter in the bottom right will still display '2/8', the title of page 3 *is* shown, but the content is not. If I click the next button again it will take me to page 4, and then when I click back to page 3 it *does* show the content of page 3.

Please Log in or Create an account to join the conversation.

Embed content (HTML+JS) only shown on 2nd viewing 8 years 7 months ago #3629

  • Susanne
  • Susanne's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
I have fixed it.

My Google charts component was loading too slowly (at least, in Xerte, not when I run it stand-alone).

Previously, this would not work, as on the first viewing of the page loading was not yet finished and I would get an 'google is not defined' error:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
</script>

This does work:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
	
LoadGoogle();

function LoadGoogle()
{
	if(typeof google != 'undefined')
	{
		google.charts.load('current', {'packages':['corechart']});
		google.charts.setOnLoadCallback(drawChart);
	}
	else
	{
		// Retry later...
		setTimeout(LoadGoogle, 30);
	}
}
</script>

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.047 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search