No Javascript in innerHTML

Took a little debugging to figure this out. I was working with an AJAX application and was pulling some content down from the server using xmlhttpRequest, but couldn’t figure out why the little bit of javascript in the returned html wasn’t working.

Turns out that HTML is processed properly when inserted using the innerHTML calls, but javascript itself is ignored. Found a couple of references that hinted that if I were to use the DOM methods the javascript would be interpreted, but I’m not sure I want to go that way. Going to rethink how I’m handling this part of the application.