1 Replies - 479 Views - Last Post: 20 April 2013 - 08:51 AM

#1 teopp  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 34
  • Joined: 06-March 11

HTML code to JSON

Posted 20 April 2013 - 07:43 AM

Hi there guys,

I'm looking for some help here regarding the way I can transform HTML code into JSON.

I have a div, with several other divs and stuff inside. What I want is to transform this code (inside the main div) into JSON.

I've been searching for some answers, but didn't fine anything really clear about this.

So, could you guys tell me what's a way to start?

Best Regards,
Teo

Is This A Good Question/Topic? 0
  • +

Replies To: HTML code to JSON

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3175
  • View blog
  • Posts: 10,625
  • Joined: 12-December 12

Re: HTML code to JSON

Posted 20 April 2013 - 08:51 AM

There isn't an obvious way to convert HTML to JSON, although you may uncover a tool that could help if you continue searching.

But I have to ask.. why? The reason that there aren't tools to do this is because it is rarely necessary:

It is common to receive data in JSON format, and then convert it to HTML for display;
Or to pass data as HTML - that as, as an entire page or block of HTML;
Or, occasionally, to convert HTML to XML.

Perhaps you could clarify.

You could even do it this way:

{  
    "html": "... entire contents of HTML page goes here ..."  
}

but how useful this is, is a different question :)

This post has been edited by andrewsw: 20 April 2013 - 08:49 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1