본문 바로가기

웹 개발/jQuery

get an object properties in jQuery / javascript var obj = { foo: 'bar', base: 'ball' }; for(var key in obj) { alert('key: ' + key + '\n' + 'value: ' + obj[key]); } $.each(obj, function(key, value) { alert('key: ' + key + '\n' + 'value: ' + value); }); d
select box 선택해제 $('#id').val('').trigger('liszt:updated'); $('#id').find('option:first-child').prop('selected', true).end().trigger('liszt:updated'); 한참 헤맸네...
.innerHTML 과 .html() 차이!! a. jQuery('#couponModal').innerHTML b. jQuery('#couponModal').html() b를 써야하는데 a를 쓰는 바람에 장장 12시간을 개 삽질 다 했다... 아나.. 이 두 가지의 차이점은 분명히 존재한다. 특히 nyroModalManual을 사용할 경우 innerHTML을 하게 되면 nyroModalManual이 두 번 열리게 되면 IE에서는 무조건 에러를 뱉어낸다. (events가 없다는 개소리를..) 하지만 html()로 div를 읽어 들이면 에러가 없다. 왜일까? 밤새고 나서 다시 연구해볼 문제... Ref : http://www.stainlessvision.com/jquery-html-vs-innerxhtml
(jQuery object).click 이 IE에서 안될 수 있다. jQuery('#nyroModalContent #btnRefundCouponBook').click( callback ~ 위 구문은 Firefox 및 chrome에서는 아무 이상 없다. 단 IE에서는 에러 뱉어낸다... 지원하지 않는 함수 입니다. 그럴땐 아래 처럼... jQuery('#nyroModalContent #btnRefundCouponBook').live('click', function(){ 설명은 간략하게 한다면 아래처럼 누군가가 해주었는데.. you could use one of jQuery's fancy plugins like liveQuery which monitors the DOM for changes and then re-assigns the event's function when y..
[Error] Component returned failure code: 0x80070057 cell editing 후 저장할때 발생한 에러인데 - ajax로 값을 넘기거나 호출하려고 해서 발생한다. url에 jsp, php, asp 등 request가 가능한 url은 가능한데, DWR로 해야한다면? 머리가 좀 복잡해진다... 해결후에 다시..
Simple Modal 출처 : http://www.ericmmartin.com/projects/simplemodal-demos/ 압축파일내 index.html 실행화면 앞뒤 코드 다떼고 필요 소스만 남긴 후 실행 화면 간단해서 좋군요.. 이외에도 Form 간단한 알림창 등이 있는데 - 모두 js로 되어 있어서 script로 불러다 class로 사용하면 되네요.. 중요한 것은 style이 잘 정의 되어 있어야 있어보이네요.. ㅋ 아래는 필요 부분만 남긴 소스.. or Demo input title here x TEST SimpleModal Close
[Link] jQuery 50+ Amazing Examples - Part1 http://www.noupe.com/jquery/50-amazing-jquery-examples-part1.html 각 기능별로 구분해 놓았고, 각 예제는 script load후에 불러다 쓰면 되게 전부 js로 빼 놓은것이 대부분입니다. 그렇지 않은 것은 코드가 워낙 간단한 것이구요.. 점점 jQuery가 위대해 집니다..
jqGrid 설명 01 jQuery('#grid_selector').jqGrid( options ) options에 해당하는 속성들. Property Description url tells us where to get the data. Typically this is a server-side function with a connection to a database which returns the appropriate information to be filled into the Body layer in the grid - 데이터를 가지고 와야할 url을 지정하는 곳. DB연결 동시에 적합한 정보를 body부분의 grid에 채워주는 server-side 기능이다. datatype this tells jqGrid the type o..