here's the situation. I use a hidden div that i load data into and bring visible when needed. but the php pages I load into it won't execute javascript(with the exception of javascript that's written inside html tags i.e. onclick, onchange etc.)

I tried putting the javascript on the main page then calling it from events in the loaded php page but 1) it didn't fix the problem and 2) i don't want all my javascript loaded at the time the page loads, i want to load it as needed. and 3) some of the javascript executes for events, but other script i want to execute oncreate(i.e. script to resize the a fixed position div in case the window is to small).

I know it's not bad script because when I load the php file on it's own the javascript executes perfectly. It just doesn't execute when loaded from AJAX. I've run out of ideas, could I get some help on this one?