我有一个php页面,我在json中得到响应:
[{'com':'something'},{'com':'some other thing'}]
Run Code Online (Sandbox Code Playgroud)
我想循环它并将每个附加到div.
这是我试过的:
var obj = jQuery.parseJSON(response);
$.each(obj.com, function(key,value) {
alert(key+':'+value);
}
Run Code Online (Sandbox Code Playgroud)
这个警告为undefined,并且响应是json数组..
请帮忙.
我想检测智能手机上的大写字母,它们有一个小箭头,基本上是一个大写字母。
我尝试搜索它,我所能做的就是如何在台式机上进行搜索,即:
$('input').keypress(function(e) {
var s = String.fromCharCode( e.which );
if ( s.toUpperCase() === s && s.toLowerCase() !== s && !e.shiftKey ) {
alert('caps is on');
}
});
Run Code Online (Sandbox Code Playgroud)
但这在智能手机上不起作用,我怎么能实现甚至有可能呢?