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

#1 teopp   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,

Is This A Good Question/Topic? 0
  • +

Replies To: HTML code to JSON

#2 andrewsw   User is offline

  • RequestedRangeNotSatisfiable
  • member icon

Reputation: 6554
  • View blog
  • Posts: 26,569
  • 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