From my extensive reading, the iOS 5.1 localStorage/WebSQL behavior change that Apple instituted has been fully rolled into Cordova 1.6.0. However, while running on my (new)
Try using 1.7 - I had a similar issue and once I upgraded to 1.7 everything worked like it used to.
Try using localStorage vs window.localStorage syntax.
Also set what ever you're trying to call as a global variable...
var globalVar;
function onDeviceReady(){
globalVar = localStorage.getItem('something');
}