You cannot pass variables in the same way as originally. What Yahoo does is, in the listbadge.js file, it loops through all the tags <script>
on the page until it finds the one that included it, and then parses the innerHTML as JSON.
Their source was a little confusing, but here's my best understanding of it.
var scripts = document.getElementsByTagName("SCRIPT");
for (var i = 0; i < scripts.length; i++) {
var includeString = scripts[i].src;
if (includeString.match("listbadge.js")) {
if (scripts[i].innerHTML){
var passedVariables = parseJson(scripts[i].innerHTML);
}
break;
}
}
nickf
source
to share