I get the following error when loading googlechart using Ajax - when i run it normally its ok - here's the full error:
ReferenceError: google is not defined
google.load("visualization3", "1", ({packages:["corechart"]}));
This is how i'm loading the file:
<script type="text/javascript">
$('#sim_search').html('<div style="width:100%; margin-top:50px; text-align:center;">Finding your data now...<br /><br /><img src="/images_/icons/ajax-loader.gif" /></div>');
$('#sim_search').load('/pages/includes/stats.php', {});
</script>
And the top of the file being loaded:
<!DOCTYPE html>
<html lang="en" class="en">
<head>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
google.load('visualization3', '1', {packages: ['corechart']});
</script>
</head>
<body>
If I simply include the file as opposed to ajax it's ok but I need the loader image as it can take a while.
Any ideas? I've tried http as opposed to https for loading the Google API but still same error.