Closed
Bug 362132
Opened 19 years ago
Closed 19 years ago
When I try to access in JavaScript to some existing DOM HTML object's properties I got an error.
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 226193
People
(Reporter: onk, Unassigned)
Details
Attachments
(1 file)
|
2.66 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; ru; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; ru; rv:1.8.1) Gecko/20061010 Firefox/2.0
The error message is - uncaught exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOM3Document.domConfig]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: path_to_the_test_file :: print_r :: line 15" data: no]
The next JavaScript example shows this behavior:
<html>
<body>
<script language='JavaScript'><!--
function print_r(mVar,iDebugLevel){
var sOut = '';
if(iDebugLevel){
iDebugLevel--;
switch(typeof(mVar)){
case 'object':
case 'array':
sOut += typeof(mVar) + "{<BLOCKQUOTE>";
for(key in mVar){
sOut += "<br>" + "[" + key + " ] = ";
sOut += print_r(mVar[key],iDebugLevel);
}
sOut += "</BLOCKQUOTE>}";
break;
case 'string':
sOut += mVar;
break;
case 'number':
sOut += mVar;
break;
case 'boolean':
sOut += "boolean (" + mVar + ")";
break;
case 'function':
if(0){
sOut += mVar;
}else{
sOut += '...handler source code...';
}
break;
default:
sOut += typeof(mVar);
}
}else{
sOut += "...";
}
return sOut;
}
function debug_var(mVar,iDebugLevel){
oShowArea = document.createElement('DIV');
oShowArea.style.width = 640;
oShowArea.style.height = 480;
oShowArea.style.position = 'absolute';
oShowArea.style.overflow = 'auto';
oShowArea.style.left = 100;
oShowArea.style.top = 100;
oShowArea.style.backgroundColor = 'EEEEEE';
oShowArea.style.fontSize = '16px';
document.body.appendChild(oShowArea);
oShowArea.innerHTML = '<div align="center" onclick="document.body.removeChild(this.parentNode);" style="font-size:16px;background-color:FFFF55;cursor:pointer">Close</div>';
oShowArea.innerHTML += print_r(mVar,iDebugLevel);
}
function testObject(){
this.testVar1 = 1234546;
this.testVar2 = 'test string';
this.testVar3 = false;
this.testVar4 = new Array(1,2,3,'aewagery');
}
var oTestObj = new testObject();
//debug_var(oTestObj,3)
debug_var(document,3)
//-->
</script>
</body>
<html>
Reproducible: Always
Steps to Reproduce:
Save my example in the test.htm file and load it into your browser.
Actual Results:
Opera shows right results, IE and FireFox show empty "debug area".
Comment 1•19 years ago
|
||
Comment 2•19 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.1pre) Gecko/20061128 BonEcho/2.0.0.1pre ID:2006112804
For Opera 9.01, IE6 and Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.1pre) Gecko/20061128 BonEcho/2.0.0.1pre ID:2006112804, i get the same thing, a blank page displayed.
Firefox's Error Console does throw:
Warning: Event=dragdrop, use of preventBubble() is deprecated. Use W3C standard stopPropagation() instead.
Source file: chrome://browser/content/browser.xul
Error: unterminated string literal
Source file: file:///C:/Documents%20and%20Settings/Ste/Desktop/362132%20testcase.html
Line: 56, Column: 30
Source code:
oShowArea.innerHTML = '<div align="center"
------------------------------^
Comment 3•19 years ago
|
||
(In reply to comment #2)
> Firefox's Error Console does throw:
>
> Error: unterminated string literal
You didn't take Bugzilla's line breaking into account, those three lines should be just one.
*** This bug has been marked as a duplicate of 226193 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•