I can’t get the userData behavior to work in IE on WP7. (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? 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>
My first thought was to try the
-ms-prefix, as in-ms-behavior. However, I’m fairly sure the IE7/IE8 hybrid browser on Windows Phone 7 doesn’t support any behaviors whatsoever. 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.As the OP discovered, the very last section of Designing Web Sites for Mobile Phones states the following:
So, it looks like you’re out of luck.