473,655 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Oct 3 '08 #1
4 1875
SAM
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
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.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
Oct 3 '08 #3
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.
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
5681
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
1201
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 get a border around the control. However, I would like some more "depth" in my controls by using a small shadow on the right and lower side of the shape. I know I can do this by putting a very thin rectangle with a gradient brush next to the...
6
5158
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, I'm really not sure of the best way to go about it. I was hoping I could do it directly like the old shape_onclick events, but that doesn't seem to be available for GDIs so maybe I could hack something together using collections of GDI objects and...
0
1322
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 image surface. I want to erase the previous shapes at the previous positions. But how can i erase shapes in the image any ideas. Thank u.
0
7768
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 explorer but not on firefox. I dont want it to scroll sideways. in index.htm the iframe is at the bottom of the code. index.htm <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">...
0
2191
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 my diagram? Other than that, how can i loop through all the shapes in the diagram, to get their information? Visio Guy Amir Diwan
1
3303
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 hotspot link should open a new anchor link in the top frame which references a different webpage. Problem: It works fine in Firefox. When clicking on the hotspots I get the appropriate html page anchor link to reference my html page and it correctly...
8
3142
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 + '"'); I am adding a SVG shape to the page. Here is the Shape :
15
3710
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 element in Firefox.
0
8296
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.