问题
I want to use jAlert in my jquery mobile project.
Below is my code. Directory structure is perfectly fine.
<link rel="stylesheet" href="libs/jquery.mobile-1.3.2.min.css" />
<script src="libs/jquery-1.9.1.min.js"></script>
<script src="libs/jquery-ui.min.js"></script>
<!-- Core files -->
<script src="libs/jquery.alerts/jquery.alerts.js" type="text/javascript"></script>
<link href="libs/jquery.alerts/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
<script src="libs/jquery.mobile-1.3.2.min.js"></script>
I am getting following error.
"Uncaught TypeError: Cannot read property 'msie' of undefined "
Am I missing something?
How to use jAlert with jQueryMobile any example?
回答1:
According to $.browser API, $.browser.msie will not work with jQuery 1.9 or later, unless jQuery Migrate Plugin is included.
Demo
All you need is adding the below in <head>.
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
来源:https://stackoverflow.com/questions/18530791/jalert-with-jquerymobile-not-working