본문 바로가기
개발 이야기/Javascript & jQuery

remodal is not a function 해결

by 강한페페 2020. 1. 14.
반응형
<div class="remodal" data-remodal-id="modal">
	<button data-remodal-action="close" class="remodal-close" aria-label="Close"></button>
	<div class="m_log_pop">
		<h2>로그인</h2>
		<form action="/homepage_login" method="POST" id="" name="" class="">
			<p><input type="text" name="" id="" placeholder="아이디"></p>
			<p><input type="password" name="" id="" placeholder="비밀번호"></p>
			<button type="button" onclick="javascript:fn_mobile_login();">로그인</button>
		</form>
	</div>
</div>

<script>
  var inst = $('[data-remodal-id=modal]').remodal();
  inst.open();
</script>

일반적인 로그인 기능을 remodal을 사용해서 구현하려고 하는데 remodal is not a function 에러로 인해서 모달을 컨트롤 할 수가 없었다.

 

두어시간 삽질 후 결론, 동일한 이름의 jquery를 불러오는 CDN 구문이 중복되어 두개가 선언되어 있었다.

하나를 제거 후 실행하니 잘 실행된다.

반응형