컴퓨터/jquery 골드크로커다일 2018. 12. 7. 14:10
json 파싱 string을 json으로 json을 string으로 파싱하기 ~ !! //-------------------------------------------------------------------------------------------------------------------------------------- // 문서가 준비되면 $(document).ready(function(){ // json을 string 으로 var json = {"a" : "1", "b" : "2" }; console.log("json", json); var jsonString = JSON.stringify( json ); console.log("jsonString", jsonString); // string..
컴퓨터/jquery 골드크로커다일 2018. 12. 3. 11:12
jquery selectbox 제어 스크립트를 주석 처리했다 지웠다 하면서 확인해 보세요. //-------------------------------------------------------------------------------------------------------------------------------------- // 문서가 준비되면 $(document).ready(function(){ // 셀렉트 박스에 옵션 추가하기. $('#select2').append("apple1"); // 이후 추가하기 $('#select2').prepend("apple2"); // 이전 추가하기 // 선택된 option 값 $('#select1 option:selected').val(); // 선택된 o..
컴퓨터/jquery 골드크로커다일 2018. 12. 3. 11:11
jquery radio 제어. jquery checkbox와 비슷하고. checkbox에선 같은 name에서 여러개가 선택되지만 radio에선 한개만 선택된다. //-------------------------------------------------------------------------------------------------------------------------------------- // 문서가 준비되면 $(document).ready(function(){ // checked/unchecked 처리 // true는 checked, false는 unchecked 처리 // checkbox와 다른 점은 1,3을 체크해도 3만 체크 된다. 라디오는 name 같으면 한개만 선택 된다. $("..
컴퓨터/jquery 골드크로커다일 2018. 12. 3. 11:05
jquery checkbox 제어 jquery로 checkbox checked, unchecked 여부 확인 및 처리 하기 //-------------------------------------------------------------------------------------------------------------------------------------- // 문서가 준비되면 $(document).ready(function(){ // checked/unchecked 처리 // true는 checked, false는 unchecked 처리 $("#check1").prop("checked", true); $("#check2").prop("checked", false); $("#check3").pr..
컴퓨터/jquery 골드크로커다일 2018. 11. 30. 11:18
jquery text 제어 jquery로 에 value를 설정하고 가져오는 방법. //-------------------------------------------------------------------------------------------------------------------------------------- // 문서가 준비되면 $(document).ready(function(){ // #+아이디로 객체를 선택할수 있고 값을 줄수있다. $("#text1").val("아이디로 값을 주는 방법"); // text1에 들어간 값을 변수에 저장하고 text2에 값을 넣을 수 있다. var text1 = $("#text1").val(); $("#text2").val(text1); // ""으로 ..