assign $script to 'window', not to 'this'!