prototyping document.getElementById

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Thies

    prototyping document.getElementById

    It seems to me that document.getEle mentById and document.all are
    essentially the same thing.

    I'm thinking of prototyping document.getEle mentById for those browsers that
    understand document.all but not document.getEle mentById (IE4).

    Is that a reasonable thing to do? Suggestions?

    Jeff




  • Keith Bowes

    #2
    Re: prototyping document.getEle mentById

    Jeff Thies wrote:[color=blue]
    > It seems to me that document.getEle mentById and document.all are
    > essentially the same thing.
    >
    > I'm thinking of prototyping document.getEle mentById for those browsers that
    > understand document.all but not document.getEle mentById (IE4).
    >
    > Is that a reasonable thing to do? Suggestions?
    >[/color]

    It's easy and has been done before, but IE4 usage is much lower than
    Mozilla and browsers with partial IE-DOM support. Furthermore, its CSS
    support is so hopelessly antiquated, that you probably couldn't reliably
    do things common in newer browsers.

    Comment

    • HikksNotAtHome

      #3
      Re: prototyping document.getEle mentById

      In article <Xc%Gb.10413$IM 3.7695@newsread 3.news.atl.eart hlink.net>, "Jeff
      Thies" <nospam@nospam. net> writes:
      [color=blue]
      > It seems to me that document.getEle mentById and document.all are
      >essentially the same thing.
      >
      >I'm thinking of prototyping document.getEle mentById for those browsers that
      >understand document.all but not document.getEle mentById (IE4).
      >
      >Is that a reasonable thing to do? Suggestions?[/color]

      Last modified on 05-05-02
      URL: http://www.metalusions.com/backstage/articles/8/
      Does precisely what you are trying to do.
      --
      Randy

      Comment

      • Dr John Stockton

        #4
        Re: prototyping document.getEle mentById

        JRS: In article <20031226184247 .21457.00002996 @mb-m10.aol.com>, seen in
        news:comp.lang. javascript, HikksNotAtHome <hikksnotathome @aol.com>
        posted at Fri, 26 Dec 2003 23:42:47 :-
        [color=blue]
        >Last modified on 05-05-02[/color]

        Please do not post dates like that; it could mean 5th May 2003, May 5th
        2002, or 2005 May 2nd. In an international medium, one should follow
        international standards, and use YYYY-MM-DD. Actually, that is IIRC in
        ANSI X3.30-1985(R1991), FIPS PUB 4-1, 4-2.

        --
        © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
        Web <URL:http://www.merlyn.demo n.co.uk/> - w. FAQish topics, links, acronyms
        PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/> - see 00index.htm
        Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

        Comment

        • Dr John Stockton

          #5
          Re: prototyping document.getEle mentById

          JRS: In article <Xc%Gb.10413$IM 3.7695@newsread 3.news.atl.eart hlink.net>
          , seen in news:comp.lang. javascript, Jeff Thies <nospam@nospam. net>
          posted at Fri, 26 Dec 2003 18:36:39 :-[color=blue]
          > It seems to me that document.getEle mentById and document.all are
          >essentially the same thing.
          >
          >I'm thinking of prototyping document.getEle mentById for those browsers that
          >understand document.all but not document.getEle mentById (IE4).
          >
          >Is that a reasonable thing to do? Suggestions?[/color]


          Article
          From: hikksnotathome@ aol.com (HikksNotAtHome )
          Newsgroups: comp.lang.javas cript
          Date: 24 Jun 2003 21:37:32 GMT
          Subject: Re: Script Won't Upload in Netscape
          Message-ID: <20030624173732 .17796.00001037 @mb-m15.aol.com>

          included

          if (document.all && !document.getEl ementById) {
          document.getEle mentById = function(id) {
          return document.all[id];
          }
          }

          That looks worth a <FAQENTRY> to me; and I put it in my <URL:http://www.
          merlyn.demon.co .uk/js-other.htm> as an example of Object Detection.

          --
          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
          <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
          <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

          Comment

          Working...