I have set an ajax callback to a form using the form api #ajax. I also have custom jquery in a file which styles part of the page and sets click handlers. I found something funny - my custom javascript only begins working AFTER the ajax has been called on the drupal form. Before I that form api ajax is called, it doesn't work.
Why would this be?
EDIT:
I am attaching my behaviors like this:
(function($) { Drupal.behaviors.updateCart = { 'attach': function(context) { $(document).ready(function () {...
This file is being included inside of my modules hook form alter:
if($form_id == 'commerce_checkout_form_checkout') { drupal_add_js('sites/all/modules/my_subscription/js/updateCart.js'); }
custom jquery in a file
and if it is wrapped in the appropriate Drupal behavior handlers, etc.