How do I place the following javaScript in the <head>
section of the WordPress Widgets API menu screen?
<script type="text/javascript">
jQuery(window).load(function() {
jQuery("#logocheckbox").change(function() {
jQuery("#logocheckboxdiv").fadeToggle("slow");
});
});
</script>
Uncaught TypeError: Property '$' of object [object Object] is not a function
Are you positive you’re accessing the jQuery object correctly? You should look into how WordPress uses noConflict mode.
In the noConflict() mode, the global $ shortcut for jQuery is not available, but you can still use:
jQuery(document).ready(function(){
jQuery(#somefunction) ...
});
As a footnote, as a developer, whether it’s for themes or plugins, you should make use of development tools that are at your disposal. Your browser likely has a Developer Tool or Console that will show you anything that’s wrong with your code. WordPress Debugging will also flag any errors that might still work, but are technically incorrect code.