473,385 Members | 2,210 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,385 software developers and data experts.

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.getElementsByTagName("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.
Oct 3 '08 #1
4 1864
SAM
Le 10/3/08 6:34 PM, Sunny a écrit :
>
Here is the code that I am using.

var shps = document.getElementsByTagName("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.getElementsByTagName('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
Oct 3 '08 #2
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.getElementsByTagName("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
Oct 3 '08 #3
On Oct 3, 1:49 pm, Thomas 'PointedEars' Lahn <PointedE...@web.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.getElementsByTagName("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.
Oct 3 '08 #4
SAM
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
Oct 3 '08 #5

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

Similar topics

3
by: mf_sina | last post by:
Hi all! I have worked eith vb 6 and used custom shapes such as circle,elipse,Rectangle and ... But these shapes are not in vb .net? How can i get them? Best wishes...
0
by: Mats-Lennart Hansson | last post by:
Hi, I'm creating some user controls that are in different shapes. When doing this I use this.region to set the shape that I want and then I use graphics.DrawRectangle (or whatever shape I have) to...
6
by: Kristian Frost | last post by:
Hi, I'm trying to add, as you might guess, mouseclick listeners to the shapes I am drawing using the GDI+ commands in a similar sort of way as could be done with the old VB "shapes". Problem is,...
0
by: alwayssmiling | last post by:
Hi, Im drawing some shapes on the image surface (i.e when im displaying the image ) with the help of graphics. Since i want to move thsese shapes from one place to other place in the...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
0
by: weird0 | last post by:
i have successfully emebedded visio drawing tool in my application. Infinite number of shapes can be added to the drawing. How can i write double click event handler for the the shapes added to...
1
by: Jahamos | last post by:
Background: I have copy and pasted an Excel flowchart into a Dreamweaver html page. I created a frame on the top of the page as a viewer. I created hotspot links over the flowchart items. Each...
8
by: Sunny | last post by:
Hi, I am creating an Element on page in Firefox. But It gives me an error in Firefox. String contains an invalid character" code: "5 county = document.createElement('"' + countyVMLtext +...
15
by: Sunny | last post by:
Hi, I can change the lement opacity in IE using. abc.style.filter = 'alpha(opacity=' + 10 + ')'; But this dont work in firefox, In firefox it throws error. How I can change the opacity of an...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.