Script Execution
When calling .load() using a URL without a suffix for the selector expression, the content is passed .html() until the scripts are deleted. This is done before the script blocks before dropping them. However, if .load() is called with a selector expression appended to the URL, the scripts are deleted before the DOM is updated and thus are not executed. An example of both cases can be seen below:
Here, any JavaScript loaded in #a as part of the document will succeed.
$('#a').load('article.html');
However, in the following case, the script blocks in the document loaded in #b are deleted and not executed:
$('#b').load('article.html #target');
Source: jQuery.com
source share