목록Web/front-end (21)
blog
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // parameter 이름으로 값을 얻는 방법(정규식) function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } var hello_var = getParameterByName('hello'); Colored by C..
DataTables 내부에 버튼 만들기 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 var table = $('#dataTable3').DataTable({ select: true, data: tableDataList, "columns": [{ data: "name" }, { data: "age" }, { data: "office" }, { data: null, render: function(data, type, row) { var myBtnElem = "버튼"; return myBtnElem; } } ], rowCallback: function(row, data) { var str = data.mouseoverComment.rep..
[해당 페이지 URL 가져오기] document.location.href [URL parameter 값 가져오기] location.search [?age=60&office=london] 이런 형식으로 가져온다. 참고 : https://fellowtuts.com/jquery/getting-query-string-values-in-javascript/?a=a 예시 https://example:8090/current_page_url?age=60 window.location.hostname; // example window.location.href; // https://example:8090/current_page_url?age=60 window.location.host; // example:8090 windo..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 var table = $('#dataTable3').DataTable({ select: true, data: tableDataList, "columns": [ { data: "name" }, { data: "age" }, { data: "office" }, ], rowCallback: function(row, data) { var str = data.mouseoverComment.replace(" ", "\n"); $(row).attr('title', str); } }); Colored by Color Scripter cs 참고 : http://live.datatables.net/disociyu/1/edit
1 2 3 4 5 6 7 8 9 10 // 팝업을 호출 할 페이지의 js function winPopup(popup_num) { var popUrl = "../" + popup_num; var popOption = "width=1000, height=1000, status=no, menubar=no, toolbar=no, resizable=yes"; window.open(popUrl, popup_num + " 팝업", popOption); return false; } Colored by Color Scripter cs 팝업을 호출 할 페이지의 js 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 b..
1 2 3 4 5 6 7 8 9 10 11 12 Name Start End Comment Colored by Color Scripter cs 테이블의 를 만들어줄 것이다. 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 // dataTable1 생성 data_list = new Object(); $.ajax({ type : "GET", url : "http://localhost:포트/v1/api", dataType : "json"..