I got this code here…
<script type="text/javascript">
$('document').ready(function() {
alert($('.thickbox'));
});
</script>
and I put this code in my wordpress theme footer.php file at the bottom. When I went to my page, the alert did not appear, I check my error console and found this error
TypeError: $ is not a function
$('document').ready(function() {
what gives? my jquery file is in the header, so this should work…or is there a specfic way to put jquery in wordpress?
WordPress’s packaged jQuery defaults to
noConflict
mode, usejQuery('document')
, or wrap your code likeor in your document ready like this:
try jQuery instead of $
‘$’ is just an alias for ‘jQuery’. if
$('document')
isn’t working, tryjQuery('document')