pyrsmk/toast — Issue #1: Be sure that script is loaded
Author: maslennikov
Created: 2012-02-01 22:38:28+00:00
State: open

From your wiki, I've read:

Sometimes, on some browsers, scripts are not parsed yet when we want to use them (like calling a function from that script). To resolve that issue, toast provides a simple way:
```
toast(
'scripts/jquery.js',
function(){
// The callback will be called until `$` is not set
if(!window.$){
return false;
}
// jQuery actions
// .....
}
);
```

When it could happen, I don't really understand. If loader provide callback function, it means, that callback will be called when loader has already load the script, than functions from this script are available.

So, I need `if (!some_var_from_script){ return false;}` protection in every script I load/