Closed didiercrunch closed 11 years ago
Hi thanks for the contribution. I think this is beyond the scope of what I was trying to do. The main reason is that it makes the page non-indexable by search engines (since the content is on a separate file) and slow to load.
A bit of feedback anyway:
XMLHttpRequest
is being used synchronously. This is considered bad practice. In this particular case it'd block the main thread when it could actually be prepping the DOM for the content.Thanks again, I appreciate the effort!
Using the html5 data-* attributes, I added the possibility to put the markdown in a separate file.
For example, the two following snippets render the same thing. The only difference is that the markdown of the first snippet is in the file _hellostrapdown.js
The markdown source needs to be specified by a data-src attribute of the script tag. All other attributes of the script tag that starts with "data-" will be set to the xmp tag without the "data-".
I have not update the index.html. I am aware of cross origin problem when only using files.