473,836 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

remove attributes

I am using IE and I want to remove some attributes on my page before I
delete the rows as a result of what looks like memory leaks in my page.

I understand I can't remove the attributes, but the event handler is
removed.

here is my code:

var row_delete = document.getEle mentById("Task_ Row_"+taskNum);
var obj = row_delete.getE lementsByTagNam e("input");
for ( var i=0; i<obj.length; ++i )
{
var atts = obj[i].attributes;
for (var j=0;j<atts.leng th;j++)
{
if (atts[j].specified)
{atts[j] = null;}
}
}

I seem to get an error on this statement: atts[j] = null;

Mike

Oct 14 '05 #1
2 4571

mike wrote:
I am using IE and I want to remove some attributes on my page before I
delete the rows as a result of what looks like memory leaks in my page.

I understand I can't remove the attributes, but the event handler is
removed.

here is my code:

var row_delete = document.getEle mentById("Task_ Row_"+taskNum);
var obj = row_delete.getE lementsByTagNam e("input");
for ( var i=0; i<obj.length; ++i )
{
var atts = obj[i].attributes;
for (var j=0;j<atts.leng th;j++)
{
if (atts[j].specified)
{atts[j] = null;}
}
}

I seem to get an error on this statement: atts[j] = null;

Mike


You have an array of Attr objects. Try using the following:

if(atts[j].specified)
{
atts[j].value = "";
}

But if you're looking for a specific attribute, you should look into
using the getAttribute() method.

Oct 14 '05 #2
atts[j].value = "";

yes that works .... But It still looks like I get memory leaks.
But if you're looking for a specific attribute, you should look into
using the getAttribute() method.


http://www.quirksmode.org/dom/w3c_core.html#attributes shows this as
being incomplete for that method

Oct 14 '05 #3

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

Similar topics

4
3031
by: Mikael Petterson | last post by:
Hi, I got some help to go from: bbBusState to BB_BUS_STATE. However I found out :-( that the xml contained attributes like: TxDeviceGroup and that becomes:
12
5234
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with style attributes that I don't want to remove.
3
3094
by: sam.stamport | last post by:
Hello, In my C# program I execute an attributes remove to remove all attributes in the following root node. <xtvd xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:TMSWebServices"> All attributes are removed EXCEPT
8
10510
by: Gerry Viator | last post by:
Hi all, The following is part of XML file, how do I search through the file and remove an Element and all it's attributes. Example: TEST2? Of course I will pass the Element Name to remove from a control. - <Forms> - <Form Name="TEST1">
8
2644
by: Mikey | last post by:
I have an XML document as follows: <Menu> <Group> <Item Text="About Us" AccessRoles="All"> <Group> <Item Text="Option 1" AccessRoles="All" /> <Item Text="Option 2" AccessRoles="All" /> <Item Text="Option 3" AccessRoles="All" /> </Group>
2
2121
by: fizzy | last post by:
i am fetching an xml document with the following structure: <?xml version="1.0" encoding="UTF-8"?> <DTCResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:/ows/aws/1.2 http://www.overture.com/schema/dtc/1.2/dtc_response.xsd" xmlns="urn:/ows/aws/1.2" success="true"> <ActionsResponse accountId="123"> <GetAccountIdsResponse success="true"> <Account id="123" market="UK" /> ....
0
1146
by: Jonas | last post by:
Hi! I'm working with an ASP.NET web site that needs to conform with XHTML 1.0 Transitional and got an ASP.NET HtmlInputButton which automatically adds the attribute language="javascript" which isn't allowed in XHTML. I've tried to remove this attribute by executing QuickSearchButton.Attributes = ""; or QuickSearchButton.Attributes = null; or QuickSearchButton.Attributes.Remove("language");
0
1471
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want to add mutiple selected items to another listbox after clicking button1, and similray remvoing the mutiple selected ite,s from, another after clicking button2 ,, how can i do this ,, my script is given belo...
0
1322
by: Ismail | last post by:
Guys, I have the following code in page_load event of user control Go.Attributes.Add("onclick","if(" + search.ClientID + ".value==''){alert('" + noSearchText + "');return false;}"); Go.Attributes.Remove("border"); the add works fine however the remove does not. I have tried moving the
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
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
10551
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 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...
1
10595
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
9379
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...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5828
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4458
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
4021
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.