473,513 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unexpected call error in IE 5

I'm dynamically building some html OBJECT code and I use this function
to and PARAM elements:

// function to add a PARAM element to an element (parent, name, value)
addParam = function(prt,n,v) {
var p = document.createElement("param");
p.name = n;
p.value = v;
prt.appendChild(p);
}

It appears to work fine with IE6, MZ1.7.5, and FF1.0 but IE5 and 5.5
complain that the line "par.appendChild(p);" does this:

"unexpected call to method or property access"

What's happening and how can it be fixed?

Andrew Poulos
Jul 23 '05 #1
1 6296


Andrew Poulos wrote:
I'm dynamically building some html OBJECT code and I use this function
to and PARAM elements:

// function to add a PARAM element to an element (parent, name, value)
addParam = function(prt,n,v) {
var p = document.createElement("param");
p.name = n;
p.value = v;
prt.appendChild(p);
}

It appears to work fine with IE6, MZ1.7.5, and FF1.0 but IE5 and 5.5
complain that the line "par.appendChild(p);" does this:

"unexpected call to method or property access"

What's happening and how can it be fixed?


IE (at least on Win) unfortunately is a bit picky about the elements you
can call methods like appendChild on, the documentation
<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/appendchild.asp>
indeed doesn't list <object> and I remember similar problems when trying
to call appendChild on a <style> or <script> element object.
Sometimes more IE specific properties or methods do work, for <object>
insertAdjacentElement is documented so perhaps
if (prt.insertAdjacentElement) {
prt.insertAdjacentElement('beforeEnd', p);
}
else if (prt.appendChild) {
prt.appendChild(p);
}
but I haven't tested that, try yourself, if it doesn't work you might
need to try other ways (calling insertAdjacentHTML where you want to
insert the complete <object> or setting innerHTML or outerHTML of an
element to insert the markup for <object> and its <param>s).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

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

Similar topics

1
3706
by: Gil | last post by:
This is a question involving CORBA but the problem shows up using Sun C++. The problem doesn't occur with Visual C++ 6. I'm using a string in the following form in my CORBA IDL declaration so...
1
1842
by: Ken | last post by:
Any thoughts on making explicit calls to unexpected()? My sense is that this function is really intended to be invoked automatically as part of exception handling. Are there times when explicit...
3
7371
by: Eric Anderson Vianet SAO | last post by:
hello all When i tried ´pg_dump -v -f dump.dmp dtbtransporte´ I got the error: pg_dump: restoring data for table tbdmovimento pg_dump: dumping out the contents of table tbdmovimento ...
3
11039
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
2
2399
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a...
0
1013
by: Random | last post by:
I need help on knowing where to look for the source of this error. I have an assembly that I am using to make all the calls to my web service from my ASP.NET web application. Almost every time I...
6
5475
by: Yoel | last post by:
Hi, I'm trying consuming web services over SSL by an ASP .Net client without success. System Architecture: My Server side contains the following layers, starting from the client side: ...
3
3289
by: tol7481 | last post by:
Hi, I'm trying to deploy a Java stored procedure on DB2 V8 on a Linux box, but I have some problems. I've added to the classpath the following JARs sqllib/java/db2java.zip...
1
8821
by: Mrozik | last post by:
Hi! I have a problem - after deploying application in client environment, on some client machines occured error. Environment: App server: ASP.NET WebService/Win 2003/ secured SSL (.NET 2.0)...
0
4214
by: =?Utf-8?B?UGF2aQ==?= | last post by:
Hi, I am getting the following error when I try to add web reference from Visual Studio 2005 for a third party web service There was an error downloading...
0
7171
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...
0
7388
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
7545
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...
1
7111
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
5692
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,...
0
3240
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...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
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 ...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.