Only on Windows Mobile 7.5 (Mango), when changing the location of an IFRAME through Javascript. The x$.ready inside the framed page seem to fire too early, such that getElementById returns null all the time. Well, basically, the DOM isn't ready and we're trying to touch it.
The (dirty) workaround is in the reproducer: stick to the body tag's "onload"
Running the reproducer:
Save all the files. Add the IE-specific XUI javascript base.
Host the pages so they can be access through a mobile web-browser
Open iewrap.html on a Windows 7.5 phone.
Try the two buttons at the bottom.
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Nothing</title>
</head>
<body onload="document.getElementById('val').value='I was written by JS';">
<p>With regular markup JS</p>
<p>body's onload will set the value below</p>
<input type="text" id="val" name="val" value="Attempt failed" />
</body></html>
somejswithxui.html:
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Nothing</title>
<script src="xui-ie-2.3.2.js"></script>
<script>
x$.ready(function(){
document.getElementById('val').value='I was written by JS';
});
</script>
</head>
<body>
<p>With XUI</p>
<p>x$.ready will attempt to set the value below</p>
<input type="text" id="val" name="val" value="Attempt failed" />
</body></html>
Only on Windows Mobile 7.5 (Mango), when changing the location of an IFRAME through Javascript. The x$.ready inside the framed page seem to fire too early, such that getElementById returns null all the time. Well, basically, the DOM isn't ready and we're trying to touch it.
The (dirty) workaround is in the reproducer: stick to the body tag's "onload"
Running the reproducer: Save all the files. Add the IE-specific XUI javascript base. Host the pages so they can be access through a mobile web-browser Open iewrap.html on a Windows 7.5 phone. Try the two buttons at the bottom.
Source code for reproducer:
iewrap.html:
nojs.html:
somejs.html:
somejswithxui.html: