JavaScript support for handhelds...

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>
 
W

wmc

Never mind... I'm just not used to using handhelds.

Somehow I wasn't clicking the form button correctly with the stylus.
 
W

wmc

After adding test code (typeof) I realized that JavaScript support in
Pocket IE is not as far along as I thought.

document.getElementById is not supported in the pocket IE on this device
but document.All is. Just like the bad old days on the desktop.

I was assuming that IE on all WM5 devices would support getElementById.
Oh well...

--wmc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top