Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 구글
- SQL
- LINQ
- 클래스
- It
- 메소드
- jQuery
- JavaScript
- XML
- IT 관련
- asp.net mvc
- 제네릭
- ASP.NET
- Generic
- delegate
- mvc
- iframe
- angularJS
- MSSQL
- cookie
- ADO.NET
- c#
- di
- IT관련
- csv
- Excel
- 디자인패턴
- 동적dom
- Today
- 69
- Total
- 1,439,788
심재운 블로그
jQuery 의 outerHTML() 플러그인 본문
outerHTML 에 대한 함수 지원을 몇군데 브라우저에서 지원하지 않아 아래 처럼 플러그인을 사용하면 가져올 수 있다.
출처 : http://boedesign.com/blog/2011/03/31/outerhtml-plugin-for-jquery/
/** Full example here: http://jsfiddle.net/jboesch26/3SKsL/1/*/$.fn.outerHTML = function(){// IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloningreturn (!this.length) ? this : (this[0].outerHTML || (function(el){var div = document.createElement('div');div.appendChild(el.cloneNode(true));var contents = div.innerHTML;div = null;return contents;})(this[0]));}console.log('native outerHTML: ' + $('#colors')[0].outerHTML);console.log('jQuery cross-browser outerHTML: '+ $('#colors').outerHTML());
'프로그래밍 > jQuery' 카테고리의 다른 글
Ajax 요청 후, 다른 페이지 이동 후 뒤로가기 처리하기 (0) | 2013.04.04 |
---|---|
꺾은선 그래프 무료 (0) | 2012.10.29 |
jQuery 의 outerHTML() 플러그인 (0) | 2012.07.25 |
jQuery Twitter Search Plugin (0) | 2012.07.04 |
트윗글 스크롤 내리면 다음 글 보여주는 방법 (0) | 2012.07.03 |
RC4 Symmetric Encryption/Decryption (0) | 2012.06.28 |
0 Comments