Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Name another way of invisibly embedding a JSON object in HTML in every browser without requiring CSS.


Since you asked, one option would be to simply include it as an alternative part in the MIME message (which email is). In fact, I would argue, that’s the correct option.


Probably would be the correct option but wouldn't some mail clients interpret that as a weird attachment?


They already do with all kind of stuff and it’s not really an issue. If you keep the name consistent people quickly figure out it’s not a “real” attachment.


It wouldn't be JSON, but semantic markup would be another option. (Not that I agree with the GP here, just saying.)


They do support Microdata as an alternative: https://developers.google.com/gmail/markup/reference/formats...

That allows markup for the regular html part of the mail to double as structured data for automation. I can't really decide what I prefer – this allows deduplication but gets complicated when the presentation doesn't follow the exact structure of the object you want to describe.


Yeah, they could use RDFa, which actually can represent the exact same info (they're both encodings of Linked Data). Still, this actually makes it easier for people who dislike them to filter them out of the emails.


I guess semantic markup is the full featured sibling to microformats.


Microformats are actually a kind of limited semantic markup, but here they're using JSON-LD, which can represent/encode any Linked Data, as far as I know (though they only support the schema.org ontology).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: