我尝试在插件管理区域使用虹膜颜色选择器,但当我实现时,出现了以下错误-
类型错误:$(…)。wpColorPicker不是functionCode-
function sam()
{
wp_enqueue_style( \'wp-color-picker\');
wp_enqueue_script( \'wp-color-picker\');
}
add_action( \'admin_enqueue_scripts\', \'sam\' );
<!--HTML-->
<input type="text" value="#bada55" class="ir" />
<!--SCRIPT-->
<script type="text/javascript">
jQuery(document).ready(function($){
$(\'.ir\').wpColorPicker();
});
</script>
为什么我会发现这个错误?有什么线索吗?我哪里做错了?