$.browser.msie undefined 오류
2017.08.23 00:34
0
https://eond.com/391835

외부 js 를 포함시켜 사용시


다음과 같이 호출되는 부분에서 정상적으로 동작이 안되서 확인해보니 개발자 도구에서


html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?

'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');

inst._keyEvent = false;


Uncaught TypeError: Cannot read property 'msie' of undefined

가 출력되면서 정상적으로 동작하지 않고 있었다.


구글링을 해보니 


The $.browser method has been removed as of jQuery 1.9.

jQuery.browser() removed

The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.

jQuery Core 1.9 Upgrade Guide.


라는 답변을 얻었다.


다음과 같이 직접 정의해서 사용하거나


You can check out this solution by AJ. It's pretty straightforward, just copy and paste the following lines of code.

jQuery.browser = {}; (function () { jQuery.browser.msie = false; jQuery.browser.version = 0; if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) { jQuery.browser.msie = true; jQuery.browser.version = RegExp.$1; } })();


이렇게 포함시켜서 사용할 수 있다. 필자는 포함을 시켰다.


Use the following script tag in your jsp/js file:

<script src="http://code.jquery.com/jquery-1.9.0.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

this will work for sure.

출처 - http://stackoverflow.com/questions/14923301/uncaught-typeerror-cannot-read-property-msie-of-undefined-jquery-tools

라이믹스는 이온디와 함께

닫기

마이페이지

로그인을 해주세요