У меня есть веб-страницы (здесь пример ) со старым 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 () после dataTables.net)