[태그 사용법] 태그를 사용하여 링크 이동하는 법

2022. 11. 2. 14:29·🚀 from error to study/Server

 


1. <a> 태그

<a href="<%= contextPath %>/유알엘매핑값"></a>



2. <button 태그>

1. 버튼 onclick 속성으로 직접 링크 걸기

<button onclick="location.href='<%= contextPath %>/유알엘매핑값"></button>

 

2. 버튼 onclick 속성으로 function 호출 후 해당 function에 링크 걸기 (보안성 향상)

<button onclick="changePage();"></button>

<script>
  function changePage() {
      location.href="<%= contextPath %>/유알엘매핑값";
  }
</script>




저작자표시 비영리 변경금지 (새창열림)
'🚀 from error to study/Server' 카테고리의 다른 글
  • [Server] request.getParameter(), request.getRequestDispatcher(), forward(), get/setAttribute(), 스크립틀릿
  • [input 태그 기본사항] text/radio/checkbox/range/select, option
  • [이클립스] workspace와 서버 재생성 후 환경 설정 세팅(There are no resources that can be added or removed from the server, no resources that can be added or removed from the server, localhost was unabled to start within 45 seconds)
  • [이클립스] java.io.FileNotFoundException: ~\WebContent\WEB-INF\classes\sql\driver\driver.properties (지정된 경로를 찾을 수 없습니다)
천재강쥐
천재강쥐
  • 천재강쥐
    디버거도 버거다
    천재강쥐
  • 전체
    오늘
    어제
    • Category (467)
      • 진짜 너무 궁금한데 이걸 나만 몰라...? (0)
      • 💾 Portfolio (2)
      • 🐤 CodingTest (28)
        • Java (20)
        • ᕕ(ꐦ°᷄д°᷅)ᕗ❌ (5)
      • 🚀 from error to study (142)
        • AI (1)
        • Cloud (2)
        • DB (12)
        • Front-End (16)
        • Github (14)
        • Java (39)
        • Mac (7)
        • Normal (29)
        • Server (22)
      • 📘 certificate (44)
        • 📘 리눅스마스터1급 (1)
        • 📘⭕️ 정보처리기사 (40)
        • 📘⭕️ SQLD (3)
      • 📗 self-study (234)
        • 📗 inflearn (35)
        • 📗 생활코딩 (8)
        • 📗 KH정보교육원 당산지원 (190)
      • 🎨 Scoop the others (0)
        • 📖 Peeking into other people.. (0)
        • 🇫🇷 (0)
        • 📘⭕️ 한국사능력검정시험 심화 (11)
        • 오블완 (4)
  • 인기 글

  • hELLO· Designed By정상우.v4.10.1
천재강쥐
[태그 사용법] 태그를 사용하여 링크 이동하는 법
상단으로

티스토리툴바