Is there a way to view the contents of localStorage on the iPad?
In Settings/Safari, there is a Databases entry that allows me to view databases that have been created on m开发者_JS百科y iPad (not their contents, but their size and origin).
However, I don't see any way to see what's in localStorage. I'm using the console to access localStorage in Safari (Develop > Show Web Inspector and clicking on the Storage tab).
Is there a way to view localStorage on the iPad that I'm missing?
Thanks
If you have access to an Apple computer, you can use Safari's Web Inspector to inspect stuff on your iPad - including localStorage and sessionStorage.
In your iPad, go to
Settings
>Safari
>Advanced
and turn onAllow Remote Debugging
.Then, plug it into your Apple computer.
In Safari, go to your settings and choose
Advanced
. Check the box that saysShow Develop menu in the menu bar
.Now, if you click on
develop
on the top menu bar, you will be able to see your iPad. You will be able to inspect elements and use it much like Webkit's Web Inspector.
Currently, though, it is not using the standard Webkit inspector - and many people have an issue with this.
You can access localStorage with javascript commands. (See https://developer.mozilla.org/en/dom/storage#localStorage for reference.)
To debug remotely, try using http://jsconsole.com/.
Also, you can enable viewing of console.log() output under iPad Settings -> Safari, which might help you debug locally.
精彩评论