W
wmc
From what I've read, the JavaScript/DOM support is pretty good for
handhelds, but trying a simple page which works on the desktop doesn't
work on pocket IE on the device. I know scripting isn't completely
disabled, because I can use a script block to write a string, but I
haven't been able to call a function to change the string either from a
form button click or by adding another script block that calls the
function. Both of those work on the desktop. In fact, using a script
block to call the function doesn't even work on my device when the
string value is written statically in the HTML (so it doesn't have
anything to do with using the document.write).
Can somebody sort me out? I'm running WM5 ver 5.1.70 on this device
so I assume my Pocket IE must be fairly recent.
thanks
--wmc
* * *
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Javascript Test Page</title>
<script type="text/javascript">
function uiWrite(bReset) { // works on desktop
var con = document.getElementById("flow");
if (bReset == false) {
con.innerHTML = "STRING: bar";
} else {
con.innerHTML = "STRING: foo";
}
return true;
}
</script>
</head>
<body>
<div id="container">
<p>Test the ability to write HTML into the page using a script. As
the page loads a script writes "STRING: foo". Clicking the input button
rewrites the string. Uses getElementById, innnerHTML and DOM 0 onClick
event handler.</p>
<script type="text/javascript"> // works on device and desktop
document.write("<p id=\"flow\">STRING: foo</p>");
</script>
<form>
<input type="button" value="Rewrite as 'bar'"
onClick="uiWrite(false);" />
<input type="button" value="Reset to 'foo'"
onClick="uiWrite(true);">
</form>
</div>
<body>
</html>
handhelds, but trying a simple page which works on the desktop doesn't
work on pocket IE on the device. I know scripting isn't completely
disabled, because I can use a script block to write a string, but I
haven't been able to call a function to change the string either from a
form button click or by adding another script block that calls the
function. Both of those work on the desktop. In fact, using a script
block to call the function doesn't even work on my device when the
string value is written statically in the HTML (so it doesn't have
anything to do with using the document.write).
Can somebody sort me out? I'm running WM5 ver 5.1.70 on this device
so I assume my Pocket IE must be fairly recent.
thanks
--wmc
* * *
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Javascript Test Page</title>
<script type="text/javascript">
function uiWrite(bReset) { // works on desktop
var con = document.getElementById("flow");
if (bReset == false) {
con.innerHTML = "STRING: bar";
} else {
con.innerHTML = "STRING: foo";
}
return true;
}
</script>
</head>
<body>
<div id="container">
<p>Test the ability to write HTML into the page using a script. As
the page loads a script writes "STRING: foo". Clicking the input button
rewrites the string. Uses getElementById, innnerHTML and DOM 0 onClick
event handler.</p>
<script type="text/javascript"> // works on device and desktop
document.write("<p id=\"flow\">STRING: foo</p>");
</script>
<form>
<input type="button" value="Rewrite as 'bar'"
onClick="uiWrite(false);" />
<input type="button" value="Reset to 'foo'"
onClick="uiWrite(true);">
</form>
</div>
<body>
</html>