Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:07:02+00:00 2026-05-14T07:07:02+00:00

I have several tabs in my application, and each tab loads a different sub-page

  • 0

I have several tabs in my application, and each tab loads a different sub-page via jQuery load() function.

My problem is that some of the pages contain Google Visualization plugins and these will not work.

My first approach was to have the JavaScript for the Visualization API in the sub-page being loaded, but that did not work – the page would go blank and get stuck while loading something from apis.google.com

My second approach was to just insert a div where the visualization is supposed to go, then call a script (that I defined earlier) which would populate this div.

Here is the script that generates the visualization:

google.load('visualization', '1', {'packages':['annotatedtimeline']});
google.setOnLoadCallback(drawChart);

function drawChart() {
  var data = new google.visualization.DataTable();
  data.addColumn('datetime', 'Date');
  data.addColumn('number', 'Temperature');
  data.addColumn('number', 'Humidity');

  data.addRows([
     <?php echo /* raw data outputted by generating functions */ ?>
    ]);


  var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('visualization_div'));
  chart.draw(data, {
    displayAnnotations: true, 
    'scaleColumns': [0,1], 
'scaleType': 'allmaximized',
'displayZoomButtons': false
  });
}

Here is the script that I use to call the above script (when a tab is clicked).

$('#loadarea').load('tab1.php');
drawChart();

Also, this might be related: At the beginning of the document, I use jQuery to pre-load some other spaces on the page:

$(document).ready(function() {
  $('#side-display').load('info.php', {id:<?php echo $id ?>, mode:1});
});

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:07:02+00:00Added an answer on May 14, 2026 at 7:07 am

    There were two things wrong with this:

    1. google.setOnLoadCallback(drawChart) was calling the function, so I got rid of that.

    2. the script was attempting to fill up the div before it was loaded, so I added the function call to drawChart() inside the tab-changing script:

      $('#loadarea').load('tab1.php', function() {
      drawChart();
      });

    This works now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET forms application using a tab control with several tabs. There
I have a TabActivity with several tabs. Each tab corresponds to a specific view,
I have several ASP:TextBox controls on a form (about 20). When the form loads,
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on
I have developed an application inside ESRI ArcMAP that uses several forms that are
Let me explain the problem: Various pages of my web application contain jQuery UI
I have an application that stores database IDs in session while editing several pages
I'm trying to use jquery to create a tab effect for several div contents.
I have several similar Models (ContactEmail, ContactLetter, ContactPostalcard). Each instance (record) in, say, ContactEmail,
I have several tables whose only unique data is a uniqueidentifier (a Guid) column.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.