外部JS文件中的JQuery

我正在尝试在加载html页面时执行一些JavaScript。 调用top方法populateSelectWithDates(),但jquery部分不调用。 有任何想法吗?

function doInitialPopulation() { //This works populateSelectWithDates(); //This does not $(document).ready(function() { alert('ok'); //Credit to: http://www.pewpewlaser.com/articles/jquery-tablesorter // Adds sort_header class to ths $(".sortable th").addClass("sort_header"); // Adds alternating row coloring to table. $(".sortable").tablesorter({widgets: ["zebra"]}); // Adds "over" class to rows on mouseover $(".sortable tr").mouseover(function() { $(this).addClass("over"); }); // Removes "over" class from rows on mouseout $(".sortable tr").mouseout(function() { $(this).removeClass("over"); }); }); } 

在HTML文件中,确保按此顺序包含脚本:

     

我没有看到任何使用$(document).ready(function() {尝试删除它。让我们知道alert(’ok’)是否有效。还可以看到函数populateSelectWithDates()吗?