Client scripts accessing global objects such as 'document' are not working in scoped applications.
Console warning about the global object being null.
Example: TypeError: Cannot read property 'document' of null
There was a security change to remove those global from scoped applications, but you can disable this by setting a sys_property in that scope "glide.script.block.client.globals". See KB0551586 for full details.
If you are still having issues even after setting that property, you may be incorrectly accessing the global objects using the 'this' keyword. In global client scripts, you can access the objects using this.
But in Scoped client script, the 'this' keyword is not available, so you need to access the globals directly.
This community post has some additional information