Selesai

Export <UL><LI> elements based in a model

Proyek ini berhasil diselesaikan oleh BaNgan dengan harga $40 USD dalam sehari.

Dapatkan penawaran gratis untuk proyek seperti ini
Pemberi kerja bekerja
Anggaran Proyek
$10 - $30 USD
Diselesaikan Dalam
1 hari
Total Penawaran
14
Deskripsi Proyek

Hello

I have a <ul> with some <li> nodes that represent's node and sub-nodes...

What I need is a script to walk into <ul> <li> nodes enumerating exactly the same way like the browser does, but in a text mode based in a model of export...

To understand, take a look in the attached image... the result should be the following...

The result can be assigned to a <textarea> element

"categories": [

{"id": 0001,

"name": "Category Node 1",

"subcategories": [00011,00012,00014,00015,00016],

},

{"id": 00011,

"name": "Category Subnode 1 from Node 1",

"subcategories": [],

},

{"id": 00012,

"name": "Category Subnode 2 from Node 1",

"subcategories": [000121,000122],

},

{"id": 000121,

"name": "Category Subnode 1 from Subnode 2",

"subcategories": [],

},

{"id": 000122,

"name": "Category Subnode 2 from Subnode 2",

"subcategories": [],

},

{"id": 00014,

"name": "Category Subnode 4 from Node 1",

"subcategories": [000141,000142],

},

{"id": 000141,

"name": "Category Subnode 1 from Subnode 4",

"subcategories": [],

},

{"id": 000142,

"name": "Category Subnode 2 from Subnode 4",

"subcategories": [],

},

{"id": 00015,

"name": "Category Subnode 5 from Node 1",

"subcategories": [],

},

{"id": 00016,

"name": "Category Subnode 6 from Node 1",

"subcategories": [000161,000162],

},

{"id": 000161,

"name": "Category Subnode 1 from Subnode 6",

"subcategories": [],

},

{"id": 000162,

"name": "Category Subnode 2 from Subnode 6",

"subcategories": [],

},

{"id": 0002,

"name": "Category Node 2",

"subcategories": [],

},

{"id": 00013,

"name": "Category Node 3",

"subcategories": [],

}

]

Ingin menghasilkan uang?

  • Atur anggaran Anda dan jangka waktunya
  • Uraikan proposal Anda
  • Dapatkan bayaran atas pekerjaan Anda

Pekerjakan para freelancer yang juga menawar di proyek ini

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online