본문 바로가기

개발쬬

검색하기
개발쬬
프로필사진 Joooooooo

  • 분류 전체보기 (83)
    • 쬬의 기초정리 (13)
    • 쬬는 개발중 (36)
    • 쬬의 Vue (12)
    • 쬬의 React (14)
    • 쬬의 CSS (6)
    • 설정 (0)
Guestbook
반응형
Notice
Recent Posts
Recent Comments
Link
  • 내 벨로그
«   2025/08   »
일 월 화 수 목 금 토
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
  • develop
  • err
  • Download
  • react
  • 프론트엔드
  • Chart
  • 상태관리
  • JavaScript
  • 리액트기초
  • Package
  • NeXT
  • 리액트
  • components
  • 프론트엔드개발
  • type
  • antd
  • npm
  • VUE
  • 이미지
  • vue-cli-service
  • form
  • TradingVIew
  • vscode
  • error
  • useState
  • axios
  • frontend
  • 시멘틱태그
  • FRONT
  • CSS
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록YouTube (1)

개발쬬

[javascript] Youtube watch url 을 embed 형식으로 바꾸기

정규식을 활용해 기존 watch_url 정보를 embed 코드로 변환이 가능하다 let youtubeUrl = extractVideoID('watch_url'); let reUrl = `https://www.youtube.com/embed/${youtubeUrl}`; extractVideoID(url) { var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/; var match = url.match(regExp); if (match && match[7].length == 11) { //id 추출이 가능한경우 return match[7]; } else { //id 추출이 불가능한경우 alert("Id ..

쬬는 개발중 2022. 8. 17. 10:28
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바