У меня есть веб-страницы (здесь пример) со старым API диаграмм Google (старый статический изображения), и я хотел бы переместить его в новый API диаграмм визуализации Google.
Я также использую jQuery, jQuery UI, карты Google JS и DataTables.net (все они размещены в CDN Google и Microsoft):
<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() {
// ...
$("#comments").dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[0, "desc"]]
});
});
Поэтому я пытаюсь использовать google.loader(); вместо тегов script:
<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() {
// ...
$("#comments").dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[0, "desc"]]
});
});
К сожалению, это не работает (здесь пример страницы) - DataTables не " обернуть" стол больше.
Сообщение об ошибке в консоли Google Chrome:
jquery.dataTables.min.js:151
Uncaught ReferenceError: jQuery is not defined
У кого-нибудь есть идея, что я делаю неправильно?
Я спросил на форуме DataTables.net и...
ОБНОВЛЕНИЕ:
Я переключился с локального размещения файла dataTables.net на моем сервере на CDN Microsoft, так как это ничего не меняет в моей проблеме (я полагаю, что библиотека jQuery загружается с помощью google.load() after< /strong> dataTables.net)