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

In regards to the character encoding issue, I wonder if they could just move the #render to the top of the object by inserting it as the first property.


I'm guessing there might be issues with the streaming nature of html parsers then. If you put it at the top and the JSON is of any non-trivial size you might end up with the script trying to read invalid JSON since it's not fully loaded yet.


The script could be tied into the global onload event, so that it will only attempt to parse the JSON after the page has been fully loaded. Likely the HTML block is just placed at the bottom of the JSON for aesthetic reasons.


They could just add the "defer" attribute on the script tag to prevent that.




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

Search: