简体   繁体   English

IE userData行为在Windows Phone 7的IE中不起作用

[英]IE userData behavior doesn't work in IE for Windows Phone 7

I can't get the userData behavior to work in IE on WP7. 我无法在WP7上的IE中使用userData行为。 (Note: this refers to the original IE7 version of IE in WP7; not the IE9 version that will come with the Mango update.) Does anyone know if this is a bug, or if the behavior just isn't implemented or enabled in the first place? (注意:这是指WP7中IE的原始IE7版本;而不是随芒果更新提供的IE9版本。)有没有人知道这是一个错误,还是在行为中没有实现或启用第一名? Even better would be a workaround... I haven't found one yet. 更好的是一个解决方法......我还没有找到一个。

Minimal test case: 最小的测试用例:

<!doctype html>
<html>
    <head>
        <style>
            #store {
                behavior:url('#default#userData');
                display:none;
            }
        </style>
    </head>
    <body>
        <div id="store"></div>
        <h1>IE userData behavior test
        <script>
            var storageElement = document.getElementById("store");
            storageElement.setAttribute('monkey', 'fez');
            try {
                storageElement.save('storagetest');
                alert('Saved some data with the storage Element!'); // IE 7,8,9
            } catch(e) {
                alert("Failed to save data with the storage Element."); // IE on WP7
            }
        </script>
    </body>
</html>

(http://jsbin.com/urepoq/edit) (http://jsbin.com/urepoq/edit)

My first thought was to try the -ms- prefix, as in -ms-behavior . 我的第一个想法是尝试使用-ms-前缀,如-ms-behavior However, I'm fairly sure the IE7/IE8 hybrid browser on Windows Phone 7 doesn't support any behaviors whatsoever. 但是,我很确定Windows Phone 7上的IE7 / IE8混合浏览器不支持任何行为。 I'm unable to find solid confirmation on this, other than the few that I've tried that didn't work and the knowledge that VML (also implemented as behavior) isn't supported at all. 我无法找到这方面的确切证据,除了我尝试过的少数不起作用以及VML(也实现为行为)的知识根本不受支持。


As the OP discovered, the very last section of Designing Web Sites for Mobile Phones states the following: 正如OP所发现的那样, 设计移动电话网站的最后一部分说明如下:

Unsupported Plugins 不支持的插件

Unlike the desktop browser, Internet Explorer Mobile does not allow end users to download or install third-party plugins such as ActiveX controls. 与桌面浏览器不同,Internet Explorer Mobile不允许最终用户下载或安装第三方插件,如ActiveX控件。 Web pages should not prompt users to download plugins. 网页不应该提示用户下载插件。 Additionally Internet Explorer Mobile does not support DHTML or binary behaviors. 此外,Internet Explorer Mobile不支持DHTML或二进制行为。

So, it looks like you're out of luck. 所以,看起来你运气不好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM