Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing storage tests on IE for Windows Phone 7 #17

Closed
sunpig opened this issue Jun 24, 2011 · 7 comments
Closed

Failing storage tests on IE for Windows Phone 7 #17

sunpig opened this issue Jun 24, 2011 · 7 comments
Labels

Comments

@sunpig
Copy link

sunpig commented Jun 24, 2011

The storage tests fail for me in IE on Windows Phone 7 (device: LG Optimus 7). I've done a bit of digging, and the problem seems to be with the #userData behavior:

    var div = document.createElement( "div" ),
        attrKey = "amplify";
        div.style.display = "none";
        document.getElementsByTagName( "head" )[ 0 ].appendChild( div );
        if ( div.addBehavior ) {
            div.addBehavior( "#default#userdata" );
            // All good so far
        }

It all works up to this point. (div.addBehavior) evaluates true, and no error is thrown when adding the behavior to the div. However, when you try to load something through the div, I get an error "Object doesn't support this property or method".

            div.load( attrKey ); // Throws error

I've spent some time googling for possibilities, but I can't see anything like this reported elsewhere.

@sunpig
Copy link
Author

sunpig commented Jun 24, 2011

Minimal test case for userData storage here: http://jsbin.com/urepoq/edit

@sunpig
Copy link
Author

sunpig commented Jun 24, 2011

@sunpig
Copy link
Author

sunpig commented Jun 24, 2011

The PDF "Designing Web Sites for Phone Browsers" (http://create.msdn.com/en-US/education/catalog/article/Designing_Web_Sites_for_Phone_Browsers) by the IE Team at Microsoft has as its very last sentence: "Additionally Internet Explorer Mobile does not support DHTML or binary behaviors."

IE Mobile on WP7 also does not support HTML5 localStorage. (It is likewise difficult to find concrete information about this. I ran html5test.com on my WP7 device, and it says that localStorage is not available.)

This kind of cuts down on the options for now. IE9, when it lands, should be better.

@scottgonzalez
Copy link
Contributor

Hey @sunpig thanks for all the details. I'm hoping to get a Windows Phone 7 soon so that I can debug this and a few other issues. It doesn't seem to be a very good web device and I can't debug it right now :-(

@sunpig
Copy link
Author

sunpig commented Jun 27, 2011

I've actually been pretty impressed by the loading & rendering speed of IE7 on WP7 when browsing ordinary web sites, so long as you don't mind having to zoom and scroll all the time. But as a platform for delivering "web apps" (let alone "mobile web apps") it's...sub-optimal.

@AdamYoung
Copy link

I am also having this issue where IE on WP7 fails.
There are 2 errors that I see happening div.load( attrKey ) and div.save( attrKey ) in the userData section
I was able to get around this by adding the load and save checks to the addBehaviour check
From:
if ( div.addBehavior ) {
To:
if ( div.addBehavior && div.load && div.save ) {

It won't make local storage work on WP7 but will prevent the errors and allow it to use 'memory' for storage.
This should still allow other older IE versions to take advantage of userData.

@scottgonzalez
Copy link
Contributor

@AdamYoung, this doesn't work for two reasons. 1) You can't detect on div.load, you have to use "load" in div. 2) The load method doesn't exist until the behavior is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants