HOME 개발팁 jQuery 자주쓰는 함수

프로그램 작업하다 좋은 팁, 정보, 테스트를 기록하는 곳입니다.


jQuery | jQuery 자주쓰는 함수

페이지 정보

작성자 굿스웹 작성일19-11-19 09:38 조회754회 댓글0건

본문

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>



alert(data.result_msg); //메시지 창

window.open(hreft); //새창

document.location.href  //페이지 이동





$('input[type=text]').val("텍스트 값추가");

$('tr:odd').css('background', '#F9F9F9');

$('tr:event').css('background', '#9F9F9F');

$('tr:first').css('background', '#333333').css('color','#FFFFFF');    // 배경색 / 글자색

$('tr:eq(0)').css('background', '#000000').css('color', 'White');
$('선택').addClass('정의한 클래스이름');
$('선택'). removeClass ('삭제할 클래스이름');

arrt()
 => $('img').attr('src');
 => $(selector).attr(속성이름 , 속성값);
 => $(selector).attr(속성이름  , function( 속성각각의 index값  ,attr ){} );
 => $(selector).attr(object); 
 => $('<img />').attr('src', 'image.jpg').appendTo('body'); // body 에 img태스생성
 => $('<img />' , {src:''image.jpg, width:350, height:250}).appendTo('body');


$('h1').removeAttr('data-index') //제거

css()
$(selector).css(name , value); //추가


$('h1').html()
$(selector). text (value);
$('h1').first().remove();    // 첫번쩨 h1 삭제


trigger() //이벤트강제 발생
  $(selector).trigger(eventName)


//class 클릭
$(document).on("click", ".winhref", function () {

});


function popup(){



$(this). //현재위치


//통신 보내기
var param = {
"group"      : gro,
"type"      : gpm
}

$.ajax({
type    : "POST",
url    : "a.php",
data    : param,
dataType: "json",
success : function (data) {}
});


//버튼클릭 이동
$(document).on("click", ".href", function () {
  var hreft = $(this).attr("href");
  if(hreft) document.location.href = hreft;
});


//새창
$(document).on("click", ".winhref", function () {
  var hreft = $(this).attr("href");
  if(hreft) window.open(hreft);
});

img class="winhref m_logcode" href='이동할주소'

[숫자 콤마 찍기]
 return data.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');

[숫자 콤마 삭제]
 return str.replace(/[^\d]+/g, '');

[주소복사] https://www.goodsweb.kr/?u=D41H5G8V
SNS 알리기
핀터레스트
텔레그램로
블로그로
카카오스토리
카톡 공유

관련 블로그
로딩중


3명  IP : 3.144.♡.196
001 34.♡.82.65 뉴스기사 자동 요약 만들기 - 프로그램 개발실
(/bbs/board.php?bo_table=service&wr_id=42)
002 141.♡.61.111 오류안내 페이지
(/bbs/login_check.php)
003 120.♡.160.4 델파이 자주사용하는 함수 모음 - 개발팁
(/bbs/board.php?bo_table=tip&wr_id=93)

접속자
  • 오늘 : 181
  • 어제 : 208
  • 최대 : 874
  • 전체 : 398,250

검색로봇(Robots) 최근 방문시간
  • DAUM : 16시간 전
  • GOOGLE : 23시간 전
  • NAVER : 1일 전
  • BING : 5일 전

ETH : 0x8abf3B748ab78828AE07685e4fd53d1a606f18D3



페이스북 네이버 블로그 굿스웹 쇼핑몰 네이버 카페 굿스웹 트위터 굿스웹 티스토리 Google Play