Reputation: 6790
When a script for some custom language appears in a webpage how are these scripts executed?
<script type='text/mighty-mouse'>
// logic expressed in mighty mouse language
</script>
I would guess it would be something like this:
(I realize that we could have transcompiled before runtime to avoid having to load our interpreter.)
Is this an accurate and complete understanding?
Upvotes: 2
Views: 1096
Reputation: 10074
As far as I know there are two ways. Either a browser plugin or more likely an interpreter written in JavaScript. Which essentially scans the DOM for the correct type and interpret the content.
CoffeeScript is a good example of the later.
Upvotes: 1