473,395 Members | 1,986 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.

innerHTML not being recognized in FireFox

Hello,

First, this works fine in IE 6.5 and 7. Second, this is javascript
embedded in ASP code. The purpose of this is to assign letters to form
fields that are being rendered in an ASP loop.

First part, I assign a div tag for the "marker" positions:

do Until rs4.EOF
address = address & "<div id=""marker""></div><input type='image'
SRC='images/gobutton.gif' border=0>"
rs4.MoveNext
Loop
rs4.Close
set rs4 = nothing

Second, I confirm that we are getting the object with an alert:

Response.Write("<script type=""text/javascript""var formMarker =
document.getElementsByName('marker');alert(formMar ker);</script>")

Third, I am doing a final loop where I am outputting the values (A, B,
C)

do while iiLoop < totalRecord
Response.Write("<input type=""hidden"" name=""dealerName" & iiLoop &
""" value=""" & dynamicAddressArray(0,iiLoop) & """>")
Response.Write("<p>" & dynamicAddressArray(1, iiLoop))
iiLoop = iiLoop + 1

If iiLoop = "1" Then
Response.Write("<script type=""text/javascript"">
formMarker[0].innerHTML = 'A'</script>")
End If

If iiLoop = "2" Then
Response.Write("<script type=""text/javascript"">
formMarker[1].innerHTML = 'B'</script>")
End If

If iiLoop = "3" Then
Response.Write("<script type=""text/javascript"">
formMarker[2].innerHTML = 'C'</script>")
End If
Loop

I've Googled this, searched through many KB's and forums, tried many
different syntax variations, cannot get FireFox to output these
values.

Thank you for your time,
Buster
Jun 27 '08 #1
1 1457
"Buster" wrote:
First, this works fine in IE 6.5 and 7. Second, this
is javascript embedded in ASP code.
No it is not, it is javascript generated by ASP code. When it is "in"
the ASP it is just text, and when it gets to become javascript (when it
reaches the client) the ASP is finished.
The purpose of this is to assign letters to form
fields that are being rendered in an ASP loop.
Browsers do the 'rendering', all this loop does is assemble mark-up to
be sent to a browser.

<snip>
address = address & "<div id=""marker""></div><input
<snip>
Response.Write("<script type=""text/javascript""var
formMarker = document.getElementsByName('marker');
alert(formMarker);</script>")
<snip>

Your DIV elements don't have NAME attributes (and should not have them)
so trying to retrieve a collection of them using - getElementsByName -
should not be expected to be effective. And ID attributes are supposed
to be unique within a single document.

But why attempt to use - innerHTML - to put the content into the DIV
elements on the client when you could put the contents into the DIVs in
the mark-up generated by the ASP on the server?

Richard.
Jun 27 '08 #2

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

Similar topics

14
by: catorcio | last post by:
I'm trying to have some text in my page changed by clicking a button. Googleing around I've discovered that innerText doesn't work with every browser, so I've switched to innerHTML. It works fine...
10
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can...
9
by: Hallvard B Furuseth | last post by:
Why does the FAQ (Q 4.15) recommend innerHTML when so many here say one should use createElement(), replaceChild() etc? Also, why does the "Alternative DynWrite function" at...
2
by: sveinn | last post by:
Hi all, I've read through this group searching for an answear about this problem. Few have come close but not quite what I need. My problem is this: I'm using Ajax to fetch a new table with...
7
by: Hoss | last post by:
Hello all- This is what im trying to achieve. At the top of my page there is some search functionality, through which you cause to be loaded a string representing an HTML page. Below this and...
4
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the...
6
by: CES | last post by:
All, Visual Studio 2005 doesn't include an auto complete item for innerHTML document.getElementById("SomeID").innerHTML, is their a way of referencing the inner text of an element without using...
6
by: sonic | last post by:
Ok, i am sure everyone is sick of hearing about this. but i've checked about 10 different posts/sites about this issue, and they all say "use DOM" but i think there is more to be said. Perhaps I...
4
by: coby | last post by:
I have an application with a form that has two parts : A & B. A should be a static form while B shoudl be dynamically loaded via AJAX/PHP. Using a select box on part A, the onchange event calls...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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
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...
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.