본문 바로가기
Developer/HTML & JSP & CSS

[HTML] a테그 속성값 가공

by 순수한소년 2023. 9. 15.
728x90
반응형

@

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" trimDirectiveWhitespaces="true"%>
 
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="cfn" uri="/WEB-INF/tlds/func.tld" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
 
<body>
    <form name="fName" id="fName" method="post" autocomplete="off">
        <input type="hidden" id="hiddenTest1" value="${paramVO.hiddenTest1}" />
        <input type="hidden" id="hiddenTest2" value="${paramVO.hiddenTest2}" />
 
        <a href="#test1" class="testclass" data-test1="val">속성값을 얼마든지 가공할 수 있다.</a>
        <a href="#test2" class="testclass" data-test2="val">속성값을 얼마든지 가공할 수 있다.</a>
 
<script type="text/javascript">
//<![CDATA[
var v1, v2, timer = 500000, isProc = false, $target, seqNo;
 
$(document).ready(function() {
 
    $(document)
        .on('click','a.cltModify'function(e) {
            e.preventDefault();
            var $this = $(this), isNext = false;
            if($this.attr('data-test'== ''){
                return false;
            }
        })
        .on('click','button.btnPlay'function(e) {
            
            var $this = $(this);
            if ($this.attr('data-test'==""
             || $this.attr('data-test'=="null"
             || $this.attr('data-test'==null
             || $this.attr('data-test'==undefined
             || $this.attr('data-test'=="undefined"
            ){
                return false;
            }
            if($this.attr('data-test'!= 'Y'){
                alert('재시도가 필요합니다. \n조건완료 후 이용.');
                return false;
            }
            if(confirm('시작하시겠습니까?')){
                $.ajax({
                      method: 'POST',
                      url: '/test/testAction.do',
                      data: {hiddenTest1:$this.attr('data-test1'), data-test2:$this.attr('data-test2')},
                      dataType: 'json',
                      cache: false,
                      timeout: 1500,
                      error: function(x, t, m) {
                        if(t==="timeout") {
                            getDataList();
                            setTimeout(function() {
                                setProc(1000);
                            }, 1000);
                        }
                      }
                })
                .done(function( res ) {
                    getDataList();
                    setTimeout(function() {
                        setProc(1000);
                    }, 1000);
                });
            }
        })
 
    });
//]]>
</script>
    </form>
</body>
</html>
cs

@

728x90
반응형