在下面的代码中,除非我硬编码了对jQuery库的引用,否则页面上的jQuery位不会工作。我尝试使用的排队方法有什么问题?
在函数中。php:
if(is_admin())
{
/* LOAD ADMIN SCRIPTS
**********************************/
require_once(TEMPLATEPATH . \'/functions_private.php\');
}
在functions\\u private中。php:if( \'post.php\' == $pagenow )
{
add_action(\'admin_print_scripts\', \'my_load_ui_script\');
function my_load_ui_script()
{
wp_enqueue_script(\'jquery\');
?>
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
<script>
if(typeof jQuery!="undefined"){
alert("You have jQuery loaded");//WILL NOT FIRE UNLESS I HARDCODE JQUERY INCLUDE
}
jQuery(document).ready(function()
{
//jquery bits go here
}
}//END FUNCTION
}//END IF