473,847 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing text and object required error

Hi, I'm trying to use the following to replace a text string in all the
links on a page:

var arrLinks = document.links;
for(var LinkIterator = 0; LinkIterator < arrLinks.length ;
LinkIterator++) {
if(arrLinks[LinkIterator].firstChild.nod eValue == "More
Information"){
arrLinks[LinkIterator].firstChild.nod eValue = "More";
};
};

I'm getting an object required error for this line:

if(arrLinks[LinkIterator].firstChild.nod eValue == "More Information"){

Why is that? Also, I've placed this code near the bottom of the page.
Is this the correct way to do it? Should I be placing it in a function
and calling that? I'm a bit new to this. Thanks for your help.

Nov 25 '05 #1
1 1508
co*****@nelsonf ord.net wrote:
var arrLinks = document.links;
for(var LinkIterator = 0; LinkIterator < arrLinks.length ;
LinkIterator++) {
if(arrLinks[LinkIterator].firstChild.nod eValue == "More
Information"){
arrLinks[LinkIterator].firstChild.nod eValue = "More";
};
};

I'm getting an object required error for this line:

if(arrLinks[LinkIterator].firstChild.nod eValue == "More Information"){

Why is that? Also, I've placed this code near the bottom of the page.
Is this the correct way to do it?


Does `arrLinks' even evaluate to an object reference?
Does `arrLinks[LinkIterator]' etc.?

<http://www.pointedears .de/scripts/test/whatami>, § 2.

Anyway, the above code should be called in the `onload' event handler
attribute value of the document's `body' element to make sure the DOM
tree it is operating on was completely built.
HTH

PointedEars
Nov 25 '05 #2

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

Similar topics

8
1606
by: jamesfin | last post by:
Dear XMLers, Please guide me... I have a simple xml file... <URLTest>
6
3631
by: Peter Foti | last post by:
I have seen lots of examples where some HTML text is replaced with a background image using CSS. For example, replacing the text of an <h1> with a graphical logo, like so: CSS: h1 span { display: none; } h1 { height: 100px; background: url("mycompany.gif") no-repeat 35px 40px; } HTML: <h1><span>My Company</span></h1>
1
3777
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
31
2248
by: J.S. | last post by:
Let's say I have a text file with parameters like the following embedded in the text: @@Textbox1@@, @@Textbox2@@, etc. Is it possible to replace the parameters in the text file with values entered into textboxes in the Windows Forms UI? Thanks, J.S.
2
2360
by: Chad | last post by:
In our application, I would like to send out HTML mail. TO do so, I must do something like this: Mail.Body = <raw HTMLTEXT String> Hence, I would like to know how to get the HTML text for Web Controls. You'll notice below in lines 33-37 that that code does correctlt return the HTML for a textbox. How do I make it generic so it returns the HTML for any control. Hopefully, if the control is a container control, it will return the HTML for...
1
4194
by: amraam35 | last post by:
Here is the problem. I have made a log in script that prompts you to log in with a username and password as the "splash screen" It is an unbounded forum that checks that the username and password are in the employee table, and that they are together, and if it is, it lets you log on. That works just fine. Then i tried to make a form that you can change your password if you please. It has 4 entrys, the user name, password, and then2 of the...
6
5802
by: saif.shakeel | last post by:
Hi, I need to replace a string in xml file with something else.Ex - <SERVICEPARAMETER id="_775" Semantics="subfunction" DDORef="_54"> <SHORTNAME>rate</SHORTNAME> <LONGNAME>rate</LONGNAME> <VALUE role="constant" DataType="unsigned" value="1" /> <BYTEPOSITION role="position" BytePos="1" /> </SERVICEPARAMETER> - <SERVICEPARAMETER id="_776" Semantics="localId" DDORef="_54">
0
2925
by: mbenedict | last post by:
I am rather new at this code and am attempting to modify existing code to use clob datatypes, which I have never used before. The database tables have been set up for clob data. When trying to use dbms_lob.writeappend, I am getting the following error..Command text was not set for the command object. I've researched this in the net as much as I could, but I'm lost in what I am doing wrong. Can you help please? Here is my code... ...
1
1772
by: Manikrag | last post by:
Hi Team, This application is in ASP.Net and C#. I have Global.asax, webconfig and aspx pages on the server with code behind logic in Bin directory as DLLs. I made few changes in code behind on my local system and replaced the DLL on the server. I got below Parser Error error in global.asax. I havent changed anything in global.asax file. I build the DLL from VS Command line and it complied perfectly Please help as its urgent.
0
9887
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
9730
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
10648
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...
0
9485
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
7883
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
5719
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...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4529
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
4119
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.