본문 바로가기

study

제이쿼리 모바일 페이지 data-ajax=role 일 경우 재귀 페이지 호출시 jquery 먹통일 경우 해결 방안

data-role='ajax'를이용하여

재귀 자기 페이지로 이동 했을 경우

예를들자면...

a.asp 에서 a.asp 로 이동했을때

문제가 발생한다 망할 페이지들이 안움직인다  ㅠㅠ

LIVE 펑션을 사용하여 해결 했다 ㅋㄷㄷ

/* The jQuery .bind(), .live(), and .delegate() methods are just one 
   line pass throughs to the new jQuery 1.7 .on() method */

// Bind
$( "#members li a" ).on( "click", function( e ) {} );
$( "#members li a" ).bind( "click", function( e ) {} );

// Live
$( document ).on( "click", "#members li a", function( e ) {} );
$( "#members li a" ).live( "click", function( e ) {} );

// Delegate
$( "#members" ).on( "click", "li a", function( e ) {} );
$( "#members" ).delegate( "li a", "click", function( e ) {} );


'study' 카테고리의 다른 글