473,385 Members | 1,821 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,385 software developers and data experts.

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 6291


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
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
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
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
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
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
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
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
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
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
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.