I have web pages (here an example ) with the old Google Chart APIs (old static images) and I would like to move this to the new Google Visualization Graphics API.
I also use jQuery, jQuery UI, Google JS maps and DataTables.net (all hosted on CD and GoogleNews):
<style type="text/css" title="currentStyle"> @import "/demo_table_jui.css"; @import "https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css"; </style> <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false&language=ru"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/jquery.dataTables.min.js"></script> <script type="text/javascript"> $(function() {
Therefore, I am trying to use google.loader (); instead of script -tags:
<style type="text/css" title="currentStyle"> @import "/demo_table_jui.css"; @import "https://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css"; </style> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/jquery.dataTables.min.js"></script> <script type="text/javascript"> google.load("jquery", "1"); google.load("jqueryui", "1"); google.load("maps", "3", {other_params: "language=ru&sensor=false"}); google.setOnLoadCallback(function() {
Unfortunately, this will not work (here is a sample page ) - DataTables no longer wraps the table.
Error message in the Google Chrome console:
jquery.dataTables.min.js:151 Uncaught ReferenceError: jQuery is not defined
Does anyone have an idea what I'm doing wrong?
I asked on the DataTables.net forum ...
UPDATE:
I went from hosting the dataTables.net file locally on my server to Microsoft CDN, as it doesnβt change anything in my problem (I suppose the jQuery library loads google.load () after dataTables.net)
source share