如何使用jQuery用JSON输入创建ul-li结构?

时间:2019-02-03 17:28:32

标签: javascript jquery html json

我有一个JSON变量:

#!/bin/bash

gm convert -size 1868x2802 -density 138 cover.jpg cover.pdf
gm convert -size 1868x2802 -density 300 -compress Fax *.tiff book.pdf
file="cover+book.pdf"
pdfunite cover.pdf book.pdf $file
open $file

我想为带有ul / li结构的网站创建一个菜单,并在jQuery中使用top变量。

我尝试使用此部件代码,但这不起作用。

var links=[{"text":"Home","href":"http://home.com","icon":"fas fa-home","target":"_top","title":"My Home","children":[{"text":"home2","href":"home2.com","icon":"fas fa-chart-bar","target":"_self","title":"home2","category":"home2"},{"text":"home3","href":"home3.com","icon":"fas fa-bell","target":"_self","title":"home3","category":"home3"}]},{"text":"about us","href":"aboutus.COM","icon":"fas fa-crop","target":"_self","title":"about us","category":"about us"},{"text":"learning","href":"learning.com","icon":"fas fa-flask","target":"_self","title":"learning","children":[{"text":"learning2","href":"learning2.com","icon":"fas fa-map-marker","target":"_self","title":"learning2","category":"learning2"},{"text":"learning3","href":"learning3.com","icon":"fas fa-plug","target":"_self","title":"learning3","category":"learning3"},{"text":"learning4","href":"learning4.com","icon":"fas fa-search","target":"_blank","title":"learning4","category":"learning4"}],"category":"learning"},{"text":"map","href":"map.com","icon":"fas fa-filter","target":"_self","title":"map","category":"map"}];

我很困惑。

1 个答案:

答案 0 :(得分:0)

尝试一下:

Caused by: java.util.concurrent.TimeoutException
        at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93) ~[stormjar.jar:?]
        at com.couchbase.client.java.CouchbaseBucket.counter(CouchbaseBucket.java:656) ~[stormjar.jar:?]
        at com.couchbase.client.java.CouchbaseBucket.counter(CouchbaseBucket.java:641) ~[stormjar.jar:?]