Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- TypeORM
- 모던 자바스크립트
- AWS
- NestJS
- Deep Dive
- oauth
- 프로그래머스
- Dev-Matching
- 검색
- compateto
- invalid_grant
- api 비동기처리
- 자바스크립트
- 코멘토 #코멘토실무PT #실무PT후기 #실무강의 #리액트강의 #웹프로그래밍 #react #웹개발실무
- 우아한 테크코스
- api 요청 수 제한
- bucket4j
- 파일 url
- concurrency limit
- 프리코스
- this
- 우아한테크코스
- 유효시간 설정 url
- redis
- 딥다이브
- 프론트엔드 과제
- 타입스크립트
- 프론트엔드
- 스프링부트
- 음악 url 파일 다운로드
Archives
- Today
- Total
개발 알다가도 모르겠네요
html안에서 외부 html 불러오기 본문
728x90
<!-- html파일 불러오기 -->
<div data-include-path="navbar.html"></div>
<script>
window.addEventListener("load", function () {
var allElements = document.getElementsByTagName("*");
Array.prototype.forEach.call(allElements, function (el) {
var includePath = el.dataset.includePath;
if (includePath) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
el.outerHTML = this.responseText;
}
};
xhttp.open("GET", includePath, true);
xhttp.send();
}
});
});
</script>
'웹 > Javascript' 카테고리의 다른 글
Slice vs Splice vs Split의 차이점을 알아보자 (0) | 2022.07.07 |
---|---|
모듈을 간단하게 알아보자 (0) | 2021.08.09 |
자바스크립트의 유용한 내부 기능 (0) | 2021.08.04 |
자바스크립트 ES6 기본 문법을 알아보자 (0) | 2021.08.02 |
async 함수의 세부적인 내용 (0) | 2021.07.30 |