I'm currently developing a JavaScript script that runs on an administration page. I read up on the changes made in Drupal 7, namely the move from document.ready()
to its own jQuery function. However, the following script doesn't work.
(function ($) {
console.log('hello');
$('#edit-apiusername').append('test');
})(jQuery);
console.log()
is firing and I can see the output, but the simple append doesn't work. The field ID is correct.
I am not sure what I'm missing here, but I suspect it has to do with the way I'm referencing the object. Looking at Views 3 JavaScript code, I can see it's done in a similar way.
document.ready
. What you are reporting is not specific to Drupal 7.