Why is it that script will run from using jquery's html but not from using innerHTML?
问题 So I am a little confounded here. I do not understand why script executes when placed with jquery's .html() but not with innerHTML . I looked at the source code for jQuery's .html and it still seemed that innerHTML was being used. Can anyone explain this behavior? I came across this during an ajax response. I was getting back html and a script tag with some javascript in it, and I usually use html , but for some reason had used innerHTML this time thinking there was no difference. I