jQuery를 사용하는 일부 HTML 및 스크립트로 DOM을 업데이트하려고합니다. 업데이트되는 DOM 섹션은 jQuery 코드가 (DOM 내에서) 호출되기 전이지만 jQuery가이 코드를 배치하기 때문에 jQuery가 호출 된 후 코드가 배치됩니다.jQuery로 스크립트 삽입
가능합니까? 나는 지금 그것을 얻을 수 없다. 여기
내 HTML입니다 :<div id="readThisData">
Some data
</div>
<div id="addScript">
No script yet
</div>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script>
$(document).ready(function() {
$('#addScript').html(console.log($('#readThisData').html()));
}
</script>
http://stackoverflow.com/questions/3857874/how-to-dynamically-insert-a-script-tag-via-jquery- after-page-load - 이전에 논의되었습니다. –