473,772 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unknown runtime error

I have googled for '"Internet Explorer" "Unknown runtime error"' and not
found anything useful. I have the following (for simplicity of
presentation here):

<div><table><tr ><th id="foo"></th></tr></table></div>

In my javascript I have two lines:

var titleObj = document.getEle mentById('foo') ;
titleObj.innerH TML = "Name is bar";

IE6 is throwing an "Unknown runtime error" at the second line.

What can I do about it?
Jun 27 '08 #1
21 2128
Ugo
What can I do about it?

Mmmm, do you wait for onloading the page?
Jun 27 '08 #2
Ugo wrote:
>What can I do about it?

Mmmm, do you wait for onloading the page?
The page is already loaded. This occurs when clicking a button on the
page that brings up the div (making it visible, that is). This line is
part of that javascript that presents the box.
Jun 27 '08 #3
Ugo
>>What can I do about it?
>Mmmm, do you wait for onloading the page?
The page is already loaded. This occurs when clicking a button on the
page that brings up the div (making it visible, that is). This line is
part of that javascript that presents the box.
You add the text when the table is hidden? and then you make it visible?
If it is so, IE could get angry...
Jun 27 '08 #4
In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
posted:
>
Thank you for your suggestion. When I made that change, all hell broke
loose in the rendering of the table. Investigating, I found that my
error had nothing to do with this problem. There was an <input
type="hidden"i n the table. I had failed to close that with the "
/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
to close this so I will do it for you", and rendered the table as I
wanted it. When I fixed the error, IE also displayed properly and
without a JS error.
Restore the error, then see what W3's downloadable TIDY (used as a
checker) and also an on-line tester say about it. I predict that you
will then form the habit of using them.

<FAQENTRYSectio n 2.3.
Add something on the desirability of verifying HTML before worrying
about what the script seems to do; particularly before posting.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demo n.co.uk/- FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)
Jun 27 '08 #5
Dr J R Stockton wrote:
In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
posted:
>Thank you for your suggestion. When I made that change, all hell broke
loose in the rendering of the table. Investigating, I found that my
error had nothing to do with this problem. There was an <input
type="hidden"i n the table. I had failed to close that with the "
/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
to close this so I will do it for you", and rendered the table as I
wanted it. When I fixed the error, IE also displayed properly and
without a JS error.

Restore the error, then see what W3's downloadable TIDY (used as a
checker) and also an on-line tester say about it. I predict that you
will then form the habit of using them.

<FAQENTRYSectio n 2.3.
Add something on the desirability of verifying HTML before worrying
about what the script seems to do; particularly before posting.
I wish I could do that. However, if I do a "view source", all I see is
the template. This is on an AJAX foundation using php to write the
html. From what I have researched on the web, the validator can't be
used with php, let alone html that is written at run time via AJAX.

If I am wrong, them please enlighten me. I would love to check for
errors by validations. As it is, I found this by taking my code and
cutting and pasting into a dreamweaver window and then manually
indenting and examining it line by line. (I just indented the print
statements as I would have done for the tage).
Jun 27 '08 #6
On Mon, 05 May 2008 21:12:46 -0400, sheldonlg <sheldonlgwrote :
>Dr J R Stockton wrote:
>In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
posted:
>>Thank you for your suggestion. When I made that change, all hell broke
loose in the rendering of the table. Investigating, I found that my
error had nothing to do with this problem. There was an <input
type="hidden" in the table. I had failed to close that with the "
/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
to close this so I will do it for you", and rendered the table as I
wanted it. When I fixed the error, IE also displayed properly and
without a JS error.

Restore the error, then see what W3's downloadable TIDY (used as a
checker) and also an on-line tester say about it. I predict that you
will then form the habit of using them.

<FAQENTRYSecti on 2.3.
Add something on the desirability of verifying HTML before worrying
about what the script seems to do; particularly before posting.

I wish I could do that. However, if I do a "view source", all I see is
the template. This is on an AJAX foundation using php to write the
html. From what I have researched on the web, the validator can't be
used with php, let alone html that is written at run time via AJAX.

If I am wrong, them please enlighten me. I would love to check for
errors by validations. As it is, I found this by taking my code and
cutting and pasting into a dreamweaver window and then manually
indenting and examining it line by line. (I just indented the print
statements as I would have done for the tage).
Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
never want to use anything else. Even the obsolete 7.0 (.NET FW 1.0)
that can be had for next to nothing does the job (or in case you don't
care about Bill Gates' profit, just eMule it). Firefox script
debugger next to it is like Hyundai next to BMW.

And to see dynamically built object html, try entering into IE address
bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
Works with FF, too.

NNN

Jun 27 '08 #7
no****@nowhere. net wrote:
And to see dynamically built object html, try entering into IE address
bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
Works with FF, too.
Thanks. That was [almost] great. The "almost" is because I can't cut
and paste it. If I could do the cut and paste, I could either (a)
format it nicely to see where I may have made a mistake or (b) put it
into a separate html file that I could then validate and have W3C do
that work for me. Is there a variant that would allow me to do that.

BTW, IE changes things slightly. It removes the quotes around things
like class="thisclas s" whereas FF doesn't. However, the formatting in
IE is somewhat better in starting new lines.
Jun 27 '08 #8
no****@nowhere. net wrote:
Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
never want to use anything else.
I have tried it, and I prefer the MS Script Debugger for JScript, for its
not being evaluation software that cannot be registered, and its comparably
small memory footprint. Never wanting to use anything else would be
nonsense anyway because MS VS.NET can only debug JScript, not JavaScript or
other ECMAScript implementations .
[...]
And to see dynamically built object html, try entering into IE address
bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
Works with FF, too.
I prefer Firebug for debugging scripts in Firefox; you definitely should try
that.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Jun 27 '08 #9
no****@nowhere. net wrote:
On Wed, 07 May 2008 00:28:44 GMT, "no****@nowhere .net"
<my***********@ hotmail.comwrot e:
>On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlgwrote :
>>no****@nowhere. net wrote:

And to see dynamically built object html, try entering into IE address
bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
Works with FF, too.
Thanks. That was [almost] great. The "almost" is because I can't cut
and paste it. If I could do the cut and paste, I could either (a)
format it nicely to see where I may have made a mistake or (b) put it
into a separate html file that I could then validate and have W3C do
that work for me. Is there a variant that would allow me to do that.

BTW, IE changes things slightly. It removes the quotes around things
like class="thisclas s" whereas FF doesn't. However, the formatting in
IE is somewhat better in starting new lines.
OK, here's a 'greater' implementation that answers your prayer - but
much more heavyweight. You enter into IE address bar
javascript:get It([some id], [optional true]);
The optional parameter doesn't work with FF due to outerHTML not being
a part of its object model, but setting it to false or just omitting
works.

NNN
<textarea id="src" rows="20" cols="150" style="display: none;"
comment="I am here for testing only. Delete me in
Production." ></textarea>
<script language="javas cript" type="text/javascript">
//////////////////////////////////////////////////////////////////////////////
function getIt(id,outer)
{
//test function - displays ACTUAL HTML of the object corresponding
"id"
var ta=Get('src');
if(!ta)
{
alert('not available in this Release');
return;
}
var target=Get(id);
if(target)
{
ta.value=(outer ?target.outerHT ML:target.inner HTML);
ta.style.displa y='block';
}
else alert(id+' does not correspond to any object on the page');
}
</script>

Sorry, that was copy-paste from a place that uses stub function Get to
getElementById (just to type less - no other benefits). Replace Get
with getElementById to make the code above work - or just add this:

function Get(someId)
{return getElementById( someId);}
Thanks again. I am primarily a server side programmer (php) and Java,
c, etc. I have learned a lot of javascript over these past couple of
months, but I am still quite new to it. My question is that I have used
document.getEle mentById('src') . When is it allowable to leave off the
"document." prefix?
Jun 27 '08 #10

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

Similar topics

7
2823
by: Ivan Debono | last post by:
Hi, I keep getting an Unknown runtime error on line 3 below: 1 If oField.Type <> 136 Then 'adChapter 2 If Right(oField.name, 3) = "_id" Then 3 For Each oKey In oTable.Keys 4 If oKey.Type = 2 Then 'adKeyForeign 5 Set oCol = oKey.Columns(0)
0
1253
by: Sccr18 | last post by:
I am trying to unlock IDs using active directory. One line of code keeps giving my the same error: System.Runtime.InteropServices.COMException: Unknown error. No matter how I type this line in I get the same error. If anyone has any suggestions on how to solve this problem, it would be greatly appreciated. Examples of how the line is written: if usrobj.invoke("usrobj.IsAccountLocked = true") then if usrobj.invoke("IsAccountLocked =...
5
20448
by: Lars-Erik Aabech | last post by:
Hi! Guess it's my day again.. Tried to deploy a test release of a new asp.net web today, and got a terrible error. The web is running swell on three development computers, but when it's copied to the test server it won't work at all. Looks like aspnet_wp is trying to compile it for five seconds, then it stops working what so ever. The system event log gets the following entry: Application popup: aspnet_wp.exe - Application Error : The...
22
1882
by: José Teixeira Junior | last post by:
Hi, How i can add one new unknown control at runtime in my form1? Thaks.
10
2191
by: rwalrus | last post by:
Getting an "unknown runtime error code 0" in IE6 on the last two lines of the function below. Works fine in Firefox 1.5, I can't figure out what IE is complaining about. Both "subtotal" and "totaldiv" are divs with the respective ids, both contain only "$0" initially. function updateprice(packageName) { document.orderForm.Subpackage.value = packageName; var tempsub = getSelectedRadioValue(document.orderForm.subscription); var sub1 =...
7
38025
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 using innerHTML. Now, I've researched this problem on the web, and found many references to it, but none of them quite addressed my specific situation, and since my experience with JavaScript is limited, I was not able to adapt the solutions I...
1
11445
by: sasikumarks | last post by:
Hi, Im using the following code to retrieve the user details from the AD server. But when i execute the code,it throws me the error. Please help me in this regards."System.Runtime.InteropServices.COMException (0x8007052E): Logon failure: unknown user name or bad password. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at...
3
2077
by: vp.softverm | last post by:
hi all in the follwing part of code am getting the unknown runtime error at <select> any help .......................................... Org.getCategories({callback:function(cat) { var begin="<select name='categorylist' id='categorylist' onchange='eval(this.value);'>"; var opt="<option value=\"\" >Select Category</option>"; for(var i=0; i<cat.length; i++)
0
9621
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
9454
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
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
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
9914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
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
5355
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
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.