我有以下html:
<div class="container">
<div class="link"><a>Link</a></div>
</div>
使用以下css:
.link a {
padding-left: 30px;
position: relative;
}
.link a:before {
content: "+";
display: inline-block;
left: 0;
position: absolute;
top: 0;
}
如果我只使用jquery将a:before
悬停在$('.link a:before').hover(function () {
$(this).parent('.container').addClass("selected");
});
上,我想将一个类添加到父容器中。我尝试了以下代码,但我无法理解为什么这不起作用:
String yourString = "[{"id":1,"code":"number","field":"Customer Number","value":"123456"},{"id":2,"code":"customerName","field":"Customer Name","value":"John"}]"
JsonReader jr = new JsonReader(yourString);
JsonArray array = jr.readArray();
for(int ii=0; ii < array.length; ii++){
JsonObject obj = array.getJsonObject(ii);
String id = obj.getString("id");
String number = obj.getString("code");
//and so on...
}
jr.close();
有谁知道我做错了什么?