Hi,
In the html (as shown below) there are some <a> tags I need to move into a map.
This is no problem (in Gecko) using the js below.
However, IE 5+ (nor 6) does not want to play.
It gives me an "undefined" error and basically does not give me the objects I expect.
Undoubtfully one *can* get a hold of these objects and obviously this is the question.
How does one do this in IE??
TIA,
Fermin DCG
=============== =============== ========
html:
<table>
<tr id="1" class="segment" >
<td>
<div class="tier2">
<a href="#" class="collapse d" onclick="openCl oseSegment(this );"><span class="alt">[-] /</span></a>
<a href="#" title="Row title">Cat1</a>
<a href="#" onClick="hideUn hide(this)"><st rong>Hide</strong>
</div>
</td>
<td><input type="checkbox" name="checkbox$ 0" onClick="setChe ckbox(this);"/></td>
<td><input type="text" name="text2Edit $0" value="" align="right"/></td>
</tr>
<tr id="1-1" class="segment" >
<td>
<div class="tier3">
<a href="#" class="collapse d" onclick="openCl oseSegment(this );"><span class="alt">[-] /</span></a>
<a href="#" title="Row title">Cat1-1</a>
<a href="#" onClick="hideUn hide(this)"><st rong>Hide</strong></a>
</div> </td>
<td><input type="checkbox" name="checkbox$ 1" onClick="setChe ckbox(this);"/></td>
<td><input type="text" name="text2Edit $1" value="" align="right"/></td>
</tr>
</table>
=============== =============== ==============
..js:
for (var i=0; i < rows.length; i++) {
r = rows[i];
if (r.className==" segment") {
_segmentRows[r.id]=r;
r.open="0";
td = r.childNodes[1]; alert(td.localN ame);
div = td.childNodes[1]; alert(div.local Name);
a = div.childNodes[1]; alert(a.localNa me);
_row2a[r.id] = a;
assert("mismatc h _row2a[r.id] = a", (_row2a[r.id] == a) && (r.className="s egment") );
} 1 1678
Solved it myself.
Works both in IE 5+ as well as Gecko
F. Da Costa wrote: Hi,
In the html (as shown below) there are some <a> tags I need to move into a map. This is no problem (in Gecko) using the js below.
However, IE 5+ (nor 6) does not want to play. It gives me an "undefined" error and basically does not give me the objects I expect.
Undoubtfully one *can* get a hold of these objects and obviously this is the question. How does one do this in IE??
TIA, Fermin DCG
=============== =============== ======== html: <table> <tr id="1" class="segment" > <td> <div class="tier2"> <a href="#" class="collapse d" onclick="openCl oseSegment(this );"><span class="alt">[-] /</span></a> <a href="#" title="Row title">Cat1</a> <a href="#" onClick="hideUn hide(this)"><st rong>Hide</strong> </div> </td> <td><input type="checkbox" name="checkbox$ 0" onClick="setChe ckbox(this);"/></td> <td><input type="text" name="text2Edit $0" value="" align="right"/></td> </tr>
<tr id="1-1" class="segment" > <td> <div class="tier3"> <a href="#" class="collapse d" onclick="openCl oseSegment(this );"><span class="alt">[-] /</span></a> <a href="#" title="Row title">Cat1-1</a> <a href="#" onClick="hideUn hide(this)"><st rong>Hide</strong></a> </div> </td> <td><input type="checkbox" name="checkbox$ 1" onClick="setChe ckbox(this);"/></td> <td><input type="text" name="text2Edit $1" value="" align="right"/></td> </tr> </table>
=============== =============== ============== ..js: for (var i=0; i < rows.length; i++) { r = rows[i]; if (r.className==" segment") { _segmentRows[r.id]=r; r.open="0";
as = r.getElementsBy TagName("a"); a = as[0]; td = r.childNodes[1]; alert(td.localN ame); div = td.childNodes[1]; alert(div.local Name); a = div.childNodes[1]; alert(a.localNa me);
_row2a[r.id] = a; assert("mismatc h _row2a[r.id] = a", (_row2a[r.id] == a) && (r.className="s egment") ); } This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Raghuram Banda |
last post by:
Hi All,
Can any one help me how to create a HIDDEN element using JavaScript
(DOM) dynamically
The following codes works fine with IE but not in Netscape
currentElement = document.createElement("input");
currentElement.setAttribute("type", "hidden");
currentElement.setAttribute("name", "hiddenName");
currentElement.setAttribute("id", "hiddenName");
|
by: Robert |
last post by:
Hi,
which DOM version (level) should I learn? I've seen that there is a DOM
level 3, but is there any support for it already?
--
Rob
|
by: Richard Trahan |
last post by:
I have read through the Gecko DOM and cannot find properties
specific for forms, such as selectedIndex. Where are these
properties defined?
|
by: Zhang Weiwu |
last post by:
Hello. I often need to write cross-browser javascript, so far gecko dom
reference is the reference seems mostly suite me, for things running
well on gecko are likely to be running well on other engines. Perhaps
gecko is the closest to w3c recommendations (if not Amaya)?
Now it seems many of javascript/dom is not converted by gecko reference.
So what reference do you use? I want a very complete reference for web
scripting in HTML document...
|
by: Henri Sivonen |
last post by:
In order to keep subsequent code clear, I added a new method like this
HTMLDivElement.prototype.foo = function(arg) {
// foo for HTML div trees
}
Element.prototype.foo = function(arg) {
// foo for XML tree retrieved using XMLHttpRequest
}
| |
by: Luke Matuszewski |
last post by:
As in topic... has anyone used it ?
I tried to use it but i guess i failed... here is a code:
<html>
<head>
<title></title>
<script type="text/javascript">
function closedWin() {
confirm("close ?");
|
by: Luke Matuszewski |
last post by:
Hi.
I know that it is hard problem (as hard as CSS and HTML layouting rules
apply), but maybe someone
has some code or idea how to start it. For now i know i will cssQuery:
<URL:http://dean.edwards.name/my/cssQuery/>
My point of interest is all elements inside <div class="bodycontent">
</div>, so to get direct descendant elements i will use:
|
by: Chris Lieb |
last post by:
I am trying to add an event listener to the keyup event for some text
inputs that I am creating dynamically. I have no problems getting it
to work in Firefox, but IE just ignores them. I have created a few
functions to aid in making this process work semi-cross-browser. (I
develop in FF, but everyone who uses it will be using IE6.)
function attachEvent(_obj, _evt, _fnc) {
_evt = _evt.toLowerCase();
if (_obj.attachEvent) {
|
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,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
| |
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |