473,396 Members | 2,154 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,396 software developers and data experts.

innerhtml.... produces Microsoft Internet Explorer error

I have a web page that contains textareas. These are dynamically
added via asp when the page loads based on database records. The user
also has the ability to add more text areas via innerhtml. If the
user clicks the add text area button too fast or too many times.. they
will get the following error:

Internet Explorer Has Encountered a Problem and Needs to Close.

After reading msdns page about this error I doubt that there is a fix
to this. However, any suggestions on how I could work around this
error with a different approach than innerhtml? Any help would be
greatly appreciated. Please see the example below.

<html>
<script language="javascript">
function addvalue(){

myid.innerHTML += '<div id="mydiv2"><table border=0 cellpadding=0
cellspacing=0><tr><td width=80 align="center">&nbsp;<td><td><textarea
name="mytext"></textarea></td></tr></table></div>';
}
</script>

<body>
clicking too fast can cause ie
error<table><tr><td><table><tr><td><table><tr><td>
<input type="button" OnClick="addvalue();" value="add text area">
<div id="myid"><%
'asp code that dynamically adds textareas

%>
</td></tr></td></tr></td></tr></table>
</div>
</body>
</html>
Jul 23 '05 #1
3 1976
Jason wrote:
I have a web page that contains textareas. These are dynamically
added via asp when the page loads based on database records. The user
also has the ability to add more text areas via innerhtml. If the
user clicks the add text area button too fast or too many times.. they
will get the following error:

Internet Explorer Has Encountered a Problem and Needs to Close.

After reading msdns page about this error I doubt that there is a fix
to this. However, any suggestions on how I could work around this
error with a different approach than innerhtml? Any help would be
greatly appreciated. Please see the example below.

<html>
<script language="javascript">
function addvalue(){

myid.innerHTML += '<div id="mydiv2"><table border=0 cellpadding=0
cellspacing=0><tr><td width=80 align="center">&nbsp;<td><td><textarea
name="mytext"></textarea></td></tr></table></div>';
}
</script>
2 problems:
myid.innerHTML s/b:
document.getElementById("myid").innerHTML

You need form tags.
Mick
<body>
clicking too fast can cause ie
error<table><tr><td><table><tr><td><table><tr><td>
<input type="button" OnClick="addvalue();" value="add text area">
<div id="myid"><%
'asp code that dynamically adds textareas

%>
</td></tr></td></tr></td></tr></table>
</div>
</body>
</html>

Jul 23 '05 #2
Thank you for the reply!! However, both of the issues you mentioned are
taken care of on my live page. I was using that html/javascript as an
example. What I am looking for is an alternative to using innerhtml as
to avoid the internet explorer error. Talk to you soon.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
In article <40*********************@news.frii.net>, jf*****@hotmail.com
enlightened us with...
Thank you for the reply!! However, both of the issues you mentioned are
taken care of on my live page. I was using that html/javascript as an
example. What I am looking for is an alternative to using innerhtml as
to avoid the internet explorer error. Talk to you soon.


Use real DOM methods as applicable. See createElement, appendChild,
createTextNode, etc.

http://msdn.microsoft.com/library/default.asp?
url=/workshop/author/dhtml/reference/dhtml_reference_entry.asp

function addvalue(someNode)
{
myNewElement = document.createElement("div");
myNewElement.setAttribute("id","mydiv2");
someNode.appendChild(myNewElement);
}

e = document.getElementById("someDiv");
addValue(e);

--
--
~kaeli~
The Bermuda Triangle got tired of warm weather. It moved to
Finland. Now Santa Claus is missing.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

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

Similar topics

4
by: Reed | last post by:
I'm having a problem with apostrophes & quotes when using body.innerHTML. With the statement: bodyText = document.body.innerHTML If there was a Form object on my page such as: <input...
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...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
16
by: Joel Byrd | last post by:
I am having this ridiculous problem of trying to set the innerHTML of a div node. It works in all other browsers, but internet explorer is giving me an "Unknown runtime error". This is actually...
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: m0nkeymafia | last post by:
I have spent the past few weeks trying to figure a way around this problem, and have yet to find a good enough solution. Internet Explorer leaks memory when I update a div container using...
3
by: zero0x | last post by:
hi all, i'm trying to create something like window in javascript. there is no problem in firefox, but in microsoft internet explorer i get "Unknown error while working" (this message is in...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
6
by: prasath03 | last post by:
Hi, I developed one html page that contains one combo box for selectig mulltiple products to purchase with required quantity. I used innerHTML to add the textfield dynamically to enter the...
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
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
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
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...

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.