Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Pocket PC 2003 browser - Javascript getElementsByTagName failing

Reply
Thread Tools

Pocket PC 2003 browser - Javascript getElementsByTagName failing

 
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
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

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      05-30-2005


http://www.velocityreviews.com/forums/(E-Mail Removed) 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/
 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      05-30-2005
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.

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
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

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
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

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
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

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
FYI,
even this doesnt work
var e1 = document.all[0];
alert(e1);

 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      05-30-2005
> 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>

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-30-2005
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

 
Reply With Quote
 
vinodbijlani@gmail.com
Guest
Posts: n/a
 
      05-31-2005
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);

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What Happened to getElementsByTagName in ASP.NET 2.0 Javascript? =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==?= ASP .Net 3 03-08-2007 08:49 PM
SelectNodes vs. GetElementsByTagName =?Utf-8?B?Sm9l?= ASP .Net 2 11-02-2005 04:01 PM
getelementsbytagname question Danny XML 1 07-23-2004 11:10 AM
Setting initial focus in html using Javascript - Pocket IE on Windows 2003 Pocket PC dsnyder Javascript 2 04-14-2004 03:58 PM
Question about Document.getElementsByTagName(String) in org.w3c.dom mynamehere Java 0 12-14-2003 09:28 AM



Advertisments