Hi,
That's probably because if you add your javascript code to the form view file it is not being processed when the interface is being loaded in AJAX. I suppose because you have your code wrapped in jquery.ready (
learn.jquery.com/using-jquery-core/document-ready/
) which isn't called when the JS is run after the AJAX.
If you edit the file address / listing.php via the menu Display>Views, you'll see many times the line:
In each places, you can call your own code after the interface is being refreshed in AJAX.