In the code below, unless I hardcode a reference to the jQuery library, my jQuery bits on the page do not work. What's wrong with the enqueue method I'm trying to use?
In functions.php:
if(is_admin())
{
/* LOAD ADMIN SCRIPTS
**********************************/
require_once(TEMPLATEPATH . '/functions_private.php');
}
In functions_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