473,395 Members | 1,938 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,395 software developers and data experts.

DOMDocument.getElementsByTagName stopped working in IE

Hello everyone!

I used the code to get all elements with same tag from XML returned from the server:
Expand|Select|Wrap|Line Numbers
  1. persons = xmlhttp.responseXML.getElementsByTagName("person");
  2.  
It had worked perfect, but from one moment I started receiving an error message Object doesn't support this property or method in IE. In Opera and FF it still works fine.

I tried on IE 7 and IE 6 - the problem stays.

Then I tried to make some workaround for this issue and I wrote the following:

Expand|Select|Wrap|Line Numbers
  1. var xmlObj = new ActiveXObject("Msxml2.DOMDocument");
  2. xmlObj.loadXML('<?xml version="1.0" encoding="utf-8"?><persons><person name="Huy Morzhovy" e-mail="hyu@morzhovy.ru" language="en" /></persons>');
  3. persons = xmlObj.getElementsByTagName("person"); 
  4.  
And I'm still receiving Object doesn't support this property or method for xmlObj.getElementsByTagName("person") in IE!

I tried to google something about this problem but I failed.

Does anybody knows something about this? Maybe it's related somehow to latest changes which were installed by Windows Update on my PC...

I'll be appreciated for any help on this.
Thanks in advance.
Jan 10 '08 #1
4 10896
Ok, finally I found a bug.
It happened because variable persons was not correctly described.
Just adding
Expand|Select|Wrap|Line Numbers
  1. var persons;
  2.  
before the code above solved the problem.

But I still have questions:

1. How and why did it work before (and I'm pretty sure it worked)?
2. Why did I get false for typeof(xmlhttp.responseXML.getElementsByTagName)== 'function' when persons wasn't described?
Jan 10 '08 #2
acoder
16,027 Expert Mod 8TB
If you post the rest of your code, we might have a better idea where the problem was.
Jan 11 '08 #3
Thanks! This happened to me too, I wrote the line for XML Ajax response

response = t.responseXML;
var list = response.getElementsByTagName('row');
Nov 17 '08 #4
kewp
1
i had the same problem. i think it's because you have a control with the same id as what you're trying to assign.

so if you have

<div id="person"></div>

then IE gives an error when you say person=something;

when you say 'var person' it makes the variable local....
Feb 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bill | last post by:
I used to be able to run the following ASP code on our corp machine (W2K Server Edition and IIS-5) and successfully send a net-msg to anyone on our intranet. Last week it stopped working... and...
4
by: Dag Sunde | last post by:
I've been working on a system that have been running for the last couple of years, but stopped working on my dev. machine after reinstalling WinXP yesterday. To my knowledge, it have been set up...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
6
by: Susan Bricker | last post by:
Hi. Does anyone have a clue why my mouse wheel stopped working while I was working on the VB behind a form in MS/Access? I would swear that the mouse wheel was working a short time ago. I've...
4
by: vzaffiro | last post by:
Our Development Server (windows 2003, framework 1.1) was working great for months, then one day all the client side validators stopped working. Only the server side validation is working. Our code...
0
by: Oenone | last post by:
My VS2005 Edit and Continue function appears to have stopped working in my VB project. It definitely was working, but now when I run my project (a WinForms project) and break into it, I am...
4
by: JohnB111 | last post by:
Hi Environment: Windows XPPRO SP2 IIS 5.1 AVG Anti Virus (Not script Blocking) The following code used to work perfectly on my local development machine and still does on my web server.
2
by: Rico | last post by:
Hello, I have an ASP.net application, it's a third party forum software running on an SQL Server back end. This application was working fine with no issues. Then yesterday, without being...
1
by: rickcasey | last post by:
I wonder if anyone has experienced something like this, as it seems truly bizarre and is causing me to tear out my hair (what little there is left of it).... The exec() function just suddenly...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...
0
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,...

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.