Pocket PC 2003 browser - Javascript getElementsByTagName failing

Discussion in 'Javascript' started by vinodbijlani@gmail.com, May 30, 2005.

  1. Guest

    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
    , May 30, 2005
    #1
    1. Advertising

  2. 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/
    Martin Honnen, May 30, 2005
    #2
    1. Advertising

  3. VK Guest

    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.
    VK, May 30, 2005
    #3
  4. Guest

    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
    , May 30, 2005
    #4
  5. Guest

    , May 30, 2005
    #5
  6. Guest

    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
    , May 30, 2005
    #6
  7. Guest

    FYI,
    even this doesnt work
    var e1 = document.all[0];
    alert(e1);
    , May 30, 2005
    #7
  8. VK Guest

    > 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">Question</a>
    and later document.anchors.name and string functions to extract the
    right part.

    Or better to use a data island <xml>data</xml>
    VK, May 30, 2005
    #8
  9. Guest

    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
    , May 30, 2005
    #9
  10. Guest

    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.type;
    if((temp == "radio") && (questionForm.elements.checked)) {
    radio_buttonnames[j] = questionForm.elements.name;
    radio_buttons[j] = questionForm.elements.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);
    , May 31, 2005
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. summer00
    Replies:
    0
    Views:
    302
    summer00
    Mar 9, 2005
  2. Pierre
    Replies:
    0
    Views:
    157
    Pierre
    Nov 18, 2003
  3. Nigel Findlater

    Pocket PC 2003 with Access

    Nigel Findlater, Jan 3, 2004, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    109
    C├ęsar A. Fong Espinola
    Jan 6, 2004
  4. bruce yang
    Replies:
    7
    Views:
    237
    gtang
    Sep 6, 2005
  5. dsnyder
    Replies:
    2
    Views:
    489
    David Snyder
    Apr 14, 2004
Loading...

Share This Page