I have web page in which one part is changed dynamically (clock on menu item). I use JQuery in both pages - main - and dynamic and use function on document ready. I cannot use use only in main webpage -because some elements appear only after load internal page. So question is: Will be function onDocumentReady executed only in internal page or in both? Thanks.
If you're using an AJAX call to load your new content, then you'll have to use delegate
to set up your event bindings or set things up manually in the AJAX success callback; if you need to do something that is more complicated than binding a simple click handler (such as binding a jQuery-UI button or a form validator), then you'll have to do it by hand. For example, if you're using the load
convenience function to pull in new content:
$('#mydiv').load('/where/it/comes/from', function(responseText, textStatus, XMLHttpRequest) {
// Bind events and widgets to the new things inside #mydiv
});