Problem loading pages with ajax

Job ID: 31873598

Budget: $15 – $25 USD

I'm using XMLHttpRequest() to load pages into a div from a menu.
Using innerHTML (which I think is part of the problem) the HTML loads fine, but I have no javascript.
I've tried many of the suggestions offered on StackOverflow, but still no luck.
Presently, I can only get the js to work is through using a button to call the js function - which means it must be there somewhere. Indeed, it is 'there' as I can see it in Source. However, I cannot 'call' it - even JS embedded in the loaded page does not work - even console.log()!

I am using old style code, PHP with no classes or framework, and the same for js. I would like to keep it that way, but would settle for a jquery solution as long as it is a solution and the overhead is not too great. From what I can gather, one source of the problem is that I am not 'binding' code to elements, though I am unsure what that means.

Having spent some time on this I would say I have a couple of problems. One, of course is the right code, but the other may be one of design. It may be that I am trying to do either the wrong thing, or using the wrong way of looking at it and the relevant tools - for want of a better word.

I enclose some of the code in the attached file and a couple of screenshots.

PB
Related categories: PHP JavaScript AJAX HTML jQuery / Prototype