绑定<选择>使用 jQueryMobile/PhoneGap 更改事件选择>
我想在 PhoneGap 中运行以下 html/JS 代码, 但警报对话框未显示,LogCat 窗口中显示以下行; 出现以下警告,但警报未显示。
[错误]
W/InputManagerService(266):窗口已聚焦,忽略焦点增益:com.android.internal.view.IInputMethodClient
我只想在值更改时获取选定的值,有什么问题吗?请帮忙
[代码]
<html>
<head>
<script type="text/javascript" charset="utf-8">
$("#selectcount").change(function() {
alert('hello');
}).change();
</script>
</head>
<body>
<div id="dialog" data-role="page">
<label for="select-choice-0" class="select">Number:</label>
<select id="selectcount" name="select-choice-0" id="select-choice-0">
<option value="50">50</option>
<option value="100" selected="selected">100</option>
<option value="500">500</option>
<option value="1000">1000</option>
</select>
</div>
</body>
</html>
I want to run following html/JS code in PhoneGap,
but the alert dialog is not shown up and the following line is in the LogCat window;
the following warning appeared and alert did not showed.
[ERROR]
W/InputManagerService(266): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient
I jus want to fetch selected value on the change of the value, what's the problem? please help
[CODE]
<html>
<head>
<script type="text/javascript" charset="utf-8">
$("#selectcount").change(function() {
alert('hello');
}).change();
</script>
</head>
<body>
<div id="dialog" data-role="page">
<label for="select-choice-0" class="select">Number:</label>
<select id="selectcount" name="select-choice-0" id="select-choice-0">
<option value="50">50</option>
<option value="100" selected="selected">100</option>
<option value="500">500</option>
<option value="1000">1000</option>
</select>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在哪里加载jquery mobile?
此外,您的代码需要包装在文档就绪函数中:
Where are you loading jquery mobile?
Also, your code needs to be wrapped in the document ready function: