array loop var array = ['a', 'b', 'c']; for (var i in array) { alert(array[i]); } Passion/javascript 2016.05.26
jquery url parsing $(function(){ $.url.attr('protocol') // --> Protocol: "http" $.url.attr('path') // --> host: "www.example.com" $.url.attr('query') // --> path: "/correct/" $.url.attr('message') // --> query: "done" $.url.attr('year') // --> query: "1990" Passion/javascript 2016.05.26
bootstrap tag input https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ $("input").val()"Amsterdam,Washington,Sydney,Beijing,Cairo"$("input").tagsinput('items')["Amsterdam","Washington","Sydney","Beijing","Cairo"] Passion/javascript 2016.05.26
bpmn-js url viewer URL을 기반으로 bpmn 을 열기https://github.com/bpmn-io/bpmn-js-examples/tree/master/url-viewer 노드에 색칠하기https://github.com/bpmn-io/bpmn-js-examples/tree/master/colors css 에 highlight 추가.highlight:not(.djs-connection) .djs-visual > :nth-child(1) { fill: green !important; /* color elements as green */ } 특정 task 에 highlight를 추가함viewer.importXML(diagramXML, function() { var canvas = viewer.get('canvas'); canv.. Passion/javascript 2016.05.23
carousel 슬라이드 처럼 선택 http://www.w3schools.com/bootstrap/bootstrap_carousel.asp http://stackoverflow.com/questions/24177572/add-slides-to-bootstrap3-carousal-dynamically-using-jquery interval 설정http://stackoverflow.com/questions/10521165/bootstrap-javascript-carousel-doesnt-stop-cycling Passion/javascript 2016.05.23
ajax header 에 x-auth-token 넣기 $.ajax({ url : myurl, headers: { 'X-Auth-Token' : token }); Passion/javascript 2016.05.21
span 의 값을 jquery 로 업데이트 in my JQuery code… jQuery.noConflict(); jQuery(document).ready(function($){ var invitee = $.ajax({ type: "GET", url: "http://localhost/FormBuilder/index.php/reports/getInvitee/", async: false }).responseText; var invitee_email=eval('(' + invitee + ')'); var submitter_name=$.map(invitee_email.invites, function(j){ return j.submitter; }); alert(submitter_name); // alerts correctly $("#submitternam.. Passion/javascript 2016.05.21
jquery login 후 forward $('#login').click(function() { console.log("login"); var lg_user_id=$('#user_id').val(); var lg_password=$('#password').val(); console.log(lg_user_id); console.log(lg_password); $.ajax({ type: "POST", url: "http://104.199.167.228/api/v1/token/get", data: JSON.stringify({user_id:lg_user_id,password:lg_password}), success: function(resultData) { console.log(resultData.token); localStorage.setItem(.. Passion/javascript 2016.05.21