check the type/language of script elements
Merge pull request #3125 from seanmonstar/script-type

Check the type/language of script elements (fixes #2828); r=SimonSapin+Ms2ger