Firefox get shapes problem.

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

    Firefox get shapes problem.

    Hi I have a div called shape on my page.
    When I try to get its length using javascript in IE, everything works
    fine.

    But When I try it in Firefox it has element has no properties.

    Here is the code that I am using.

    var shps = document.getEle mentsByTagName( "shape");
    lastshp = shps.length
    alert ("there are currently: " + lastshp + " shapes")

    In IE It returns 2.
    But In Firefox it returns 0.

    Why what i am doing wrong here.
  • SAM

    #2
    Re: Firefox get shapes problem.

    Le 10/3/08 6:34 PM, Sunny a écrit :
    >
    Here is the code that I am using.
    >
    var shps = document.getEle mentsByTagName( "shape");
    are you shure that "shape" could be a *tag* ?

    shape is an *attribute* for an area (in a map)

    lastshp = shps.length
    alert ("there are currently: " + lastshp + " shapes")
    alert('there are currently : '+
    document.getEle mentsByTagName( 'area').length +
    'areas');
    In IE It returns 2.
    Toujours aussi débile ce IE !
    But In Firefox it returns 0.
    Of course !
    Why what i am doing wrong here.
    you're wrong trying to create JS and testing it in IE to see if it is
    correct.

    --
    sm

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Firefox get shapes problem.

      Sunny wrote:
      Hi I have a div called shape on my page.
      When I try to get its length using javascript in IE, everything works
      fine.
      >
      But When I try it in Firefox it has element has no properties.
      >
      Here is the code that I am using.
      >
      var shps = document.getEle mentsByTagName( "shape");
      lastshp = shps.length
      alert ("there are currently: " + lastshp + " shapes")
      >
      In IE It returns 2.
      But In Firefox it returns 0.
      >
      Why what i am doing wrong here.
      ("My neighbor has a big car, I don't. What I am doing wrong here?")

      Posting in gibberish, coding cluelessly, or both. A `div' is not a `shape',
      `shape' is not an HTML element, the tag name (type) of an element is not the
      name of this element, and you have provided too little information about
      your markup or the position of your script code for an educated guess anyway.

      <http://jibbering.com/faq/#FAQ2_3>


      PointedEars
      --
      Anyone who slaps a 'this page is best viewed with Browser X' label on
      a Web page appears to be yearning for the bad old days, before the Web,
      when you had very little chance of reading a document written on another
      computer, another word processor, or another network. -- Tim Berners-Lee

      Comment

      • Sunny

        #4
        Re: Firefox get shapes problem.

        On Oct 3, 1:49 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
        wrote:
        Sunny wrote:
        Hi I have a div called shape on my page.
        When I try to get its length using javascript in IE, everything works
        fine.
        >
        But When I try it in Firefox it has element has no properties.
        >
        Here is the code that I am using.
        >
        var shps = document.getEle mentsByTagName( "shape");
        lastshp = shps.length
        alert ("there are currently: " + lastshp + " shapes")
        >
        In IE It returns 2.
        But In Firefox it returns 0.
        >
        Why what i am doing wrong here.
        >
        ("My neighbor has a big car, I don't. What I am doing wrong here?")
        >
        Posting in gibberish, coding cluelessly, or both. A `div' is not a `shape',
        `shape' is not an HTML element, the tag name (type) of an element is not the
        name of this element, and you have provided too little information about
        your markup or the position of your script code for an educated guess anyway.
        >
        <http://jibbering.com/faq/#FAQ2_3>
        >
        PointedEars
        --
        Anyone who slaps a 'this page is best viewed with Browser X' label on
        a Web page appears to be yearning for the bad old days, before the Web,
        when you had very little chance of reading a document written on another
        computer, another word processor, or another network. -- Tim Berners-Lee
        You are right i am trying to get the shapes length on map.
        In IE, It's giving me the length.
        But why it gives 0 in Firefox.
        Can you tell me, How to get the length of shapes in firefox.

        Comment

        • SAM

          #5
          Re: Firefox get shapes problem.

          Le 10/3/08 9:46 PM, Sunny a écrit :
          >
          Can you tell me, How to get the length of shapes in firefox.
          That the length of a shape (or several shapes) could be when we know
          that a shape is a geometrical figure

          shape='rect'
          shape="circle"

          where is the length ?

          --
          sm

          Comment

          Working...