alexgorbatchev/SyntaxHighlighter — Issue #85: all() unusable if lazy loading after onload
Author: danilobuerger
Created: 2012-01-25 00:21:21+00:00
State: open

If the scripts are added after the onload happen, the all() function will not work as it tries to attach to onload which already happend. Therefore the all function should be like this:

```javascript
all : function (params) {
if (this.readyState && (this.readyState !== "complete" || this.readyState !== "loaded")) {
attachEvent(window,'load', function() { sh.highlight(params); });
} else {
sh.highlight(params);
}
}
```

The alternative would be to explicitly document this and advise to use highlight() directly when after onload.