I was playing around with writing WebParts and using the SharePoint Javascript Client Object Model (COM – I wish people would standardise this acronym soon!). I added a ScriptLink to SP.js but got this error:
Cannot make a cache safe URL for “1033/sp.js”, file not found. Please verify that the file exists under the layouts directory.
My code inside the CreateChildControls() method is as below:
ScriptLink scriptLink = new ScriptLink() { ID = "WebPartClientConsumer", Name = "sp.js", LoadAfterUI = true }; this.Controls.Add(scriptLink);
It turns out that the problem is I didn’t specify Localizable = false for the ScriptLink object.
If the script link is localizable (default), then SP will look for it under the LAYOUTS\1033 folder (the ‘1033’ is determined by the language of your OS). If it is not localizable, then SP will look for it under the LAYOUTS folder, which is where it is installed by default.