How to do a ajax within a ajax call in jquery?

How to do a ajax within a ajax call in jquery?

Hi, I am working on my website I use jquery ajax and would like to know how I can inject javascript code?

I know how to inject html. The problem I face is that I use jquery ajax post method and I inject html using the html.()

Yet I notice the javascript code dosen't get injected. it would inject only html code. So my javascript code that once the button is click in the panel to load a form in the panel.

I got a div that I will refer as a panel. At the top of the div I have a navigation menu where it's nothing but icons once pressed it will use jquery ajax post to grab html from a php file and then inject it into the div. The problem here is that I got buttons in the html code that gets injected the first time. These buttons I use javascript code that once the button is click it will run a function in this case it's the jquery ajax function that will grab html from a php file and then inject it into the div. The problem is that the javascript code doesn't get added or injected so I don't see my javascript int he source code when it's runned in the web browser. So the button does nothing.

If I add the onclick to the html of that button when I press the button it would saw that the function isn't defined.

So how do I get  javacode loaded threw ajax?