473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Pocket PC 2003 browser - Javascript getElementsByTagName failing

Guys,
I want to access all the <div> tags on my page. below is javascript
which is use to access them
var divs=document.getElementsByTagName("div");

this works on IE but is failing on Pocket PC 2003 browser.

any of guys faced this problem..any work arounds?

thanks for the help

Jul 23 '05 #1
9 2570


vi**********@gmail.com wrote:

I want to access all the <div> tags on my page. below is javascript
which is use to access them
var divs=document.getElementsByTagName("div");

this works on IE but is failing on Pocket PC 2003 browser.

any of guys faced this problem..any work arounds?


I guess
var divs = document.all.tags("div")
will do. But that is just a guess I have no pocket pc here to test.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
VK
On Pocket Internet Explorer you can use only directly addressed div's:

<div id="div1"></div>
and later:
div1.innerHTML = "New content";

You have no evident way to get it by id or from a collection.

Actually all pocket browsers is a fancy mixture of IE 3.0, JavaScript
1.0, some (VERY some) DHTML, a bit of CSS and ALWAYS a pretty good XML
parser.

If you really want to program for PDA's, you have a choice: either use
the forgotten lore of all these tricks for 3rd browsers, or program
directly with XML Island.

Jul 23 '05 #3
thanks Martin.
i got a feeling tht PPC 2003 has different IE version.. checked the
User-Agent & it is IE 4.01..

but still document.all.tags("div") is failing ..tried with CAPS
...fails (this should have worked with IE 4)

will try the id way suggested by VK...

any other suggestions
appreciate the help

Jul 23 '05 #4
i m just using the emulator
http://www.microsoft.com/downloads/d...DisplayLang=en

yet to try on real pda ..seems like its goin to be fun

Jul 23 '05 #5
Vk,
these div are built dynamically.
its basically a Question & Answer page (dynamic generation) answers are
radio buttons & checkbox. I need to build the URL to submit the
questions & selected answers for the next page
thanks

Jul 23 '05 #6
FYI,
even this doesnt work
var e1 = document.all[0];
alert(e1);

Jul 23 '05 #7
VK
> even this doesnt work var e1 = document.all[0];

As I told you :-). I have Pocket PC's for 6 year now.

This work though:
....
<div id="que1"></div>
....
que1.innerHTML = newQuestion;

No custom arrays of any kind, sorry (JavaScript 1.0)
You can use native anchors array instead of <div> to hold
question/answers/right answer info:

<a name="Answer1_Answer_2_Answer_3_RightAnswer">Quest ion</a>
and later document.anchors[i].name and string functions to extract the
right part.

Or better to use a data island <xml>data</xml>

Jul 23 '05 #8
VK
thanks for ur reply.

sorry i m not very conversent with data island. how do i use data
island for user input??
radio button ..check box?? can i?

thanks again

Jul 23 '05 #9
thanks for the help guys. fixed the problem. below is the javascript .
form.elements works just fine PPC 2003.

var j = 0;
var radio_buttons = new Array();
var radio_buttonnames = new Array();

for(var i=0; i<questionForm.length; i++){
var temp = questionForm.elements[i].type;
if((temp == "radio") && (questionForm.elements[i].checked)) {
radio_buttonnames[j] = questionForm.elements[i].name;
radio_buttons[j] = questionForm.elements[i].value;
j++;
}
}
alert("created arrays");
for(var k=0; k<radio_buttons.length; k++){
qId=radio_buttonnames[k];
answerId=radio_buttons[k];

queryString=queryString+"responseQuestionId_"+qId+ "="+qId+"&responseAnswerId_"+qId+"="+answerId+ "&";
}

alert(queryString);

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Simba | last post by:
In some pages of my website I use a code like the following: for (var n = 0; n < getTagsArray("SPAN").length; n++){ //SPAN is just an example. I also use other tags tag =...
1
by: santhosh_176 | last post by:
:I Created a Pocket PC application for iPAQ 5450. Every thing went fine even installer creation. I could run the setup and install it into the actual device and worked fine. The application enables...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
3
by: rcmail14872 | last post by:
I created a simple Data Access Page and it views fine in Internet Explorer 5.5 on my PC. But when I try to view it on my Pocket PC running Pocket PC 2002 operating system, I get the error message...
5
by: Oliver Huppert | last post by:
Hi all, can someone tell me what I need to develop applications for PPC2003 with C#? I have read several meanings about this topic. Do I need Visual Studio .NET or is Visual C# .NET Standard...
2
by: Claire | last post by:
Running visual studio .net 2003, Ive created a project for a pocket pc. I want to run it in my pocket pc 2003 emulator because if I use that particular one I can connect the emulator to activesync...
0
by: pumaken68 | last post by:
Does anyone has experience with calling web service from pocket pc 2003 project in VS 2005 environment? I just migrated a smart device(pocket pc 2003) solution from VS 2003 to VS 2005. There are...
6
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href =...
9
by: rajasekhar | last post by:
Hallo, I am developing a site, and here whats the problem is: how to partition the code, i.e. if I developed 1000 lines of code, in that I want to show first 200 lines only if the user opens my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.