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

Comments

Projects
None yet
3 participants
@sunpig

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

This comment has been minimized.

Show comment
Hide comment
@sunpig

sunpig Jun 24, 2011

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

sunpig commented Jun 24, 2011

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

@sunpig

This comment has been minimized.

Show comment
Hide comment

sunpig commented Jun 24, 2011

@sunpig

This comment has been minimized.

Show comment
Hide comment
@sunpig

sunpig 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.

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

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Jun 27, 2011

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 :-(

Contributor

scottgonzalez commented Jun 27, 2011

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

This comment has been minimized.

Show comment
Hide comment
@sunpig

sunpig 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.

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

This comment has been minimized.

Show comment
Hide comment
@AdamYoung

AdamYoung Sep 13, 2011

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.

AdamYoung commented Sep 13, 2011

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

This comment has been minimized.

Show comment
Hide comment
@scottgonzalez

scottgonzalez Oct 28, 2011

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.

Contributor

scottgonzalez commented Oct 28, 2011

@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