Is this a completely anonymous object... if so, how do you access it? [duplicate]
Possible Duplicate:
Wh开发者_运维技巧at does a script-Tag with src AND content mean?
I was just viewing this page, on how to implements Googles +1 button. When one implementation (parse explicit) showed, among other things, this code:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{parsetags: 'explicit'}
</script>
To me this looks like a completely anonymous object, but I could be mistaken.
If it is though, how is it possible to access this seemingly anonymous object? Upon writing this question, I suddenly realized it could probably be done with parsing the DOM, but that seems rather ridiculous.
So, is this an anonymous object? And if so, how is this anonymous object utilized? Is this some familiar technique I am unaware of?
Or am I just completely misinterpreting the code altogether, and is this not an anonymous object at all?
This is a hack.
If a script element has a src
attribute, then the child nodes of the script element should be ignored.
The JS attempts to find its own script element, and then extract the content from it (probably via innerHTML
but I haven't checked) and parse it.
精彩评论