Sorry for a simple question.
I'm learning about plugins. I've got some javascript that I want to put in a jQuery file in my plugin.
(I've got jQuery and the scripts enqueued, and working fine).
Is it okay if I just prepend the javasvript to the jQuery?
So, the file would look like this:
//regular javasript
function do_something() {
//do Something
}
jQuery.noConflict();
jQuery(document).ready(function() {
//my jQuery stuff
}
Is there a right way of doing this or does it not matter? If I put my straight javascript first (as above), it works.
If I put the javascript in with the jQuery, wrapping it in jQuery(document).ready(function() { }, then it doesn't.
Is it possible to add regular javascript in the jQuery ready function? Any ideas as to why it wouldn't work? I'm trying to learn.