473,698 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

runtime error: object required?

Hi,

Our webpage uses the following JavaScript code.

function toggleSubmenu(d ivId, link)
{
var div = document.getEle mentById(divId) ;
div.style.displ ay = (div.style.disp lay == 'block') ? "none" :
"block";
if (link.className == "")
link.className = "tempselect ed";
else
link.className = "";
}

Launching the page in IE pops up the error:

A runtime error has occurred. Do you wish to debug? Line:188
Error: Object required

The line reporting error is:

div.style.displ ay = (div.style.disp lay == 'block') ? "none" : "block";

The version of IE I tested is 6.0.2900.2180.x psp-sp2-gdr.050301-1519.

The page does not return any errors in other browsers (e.g. Firefox,
Netscape, etc.)

How should I fix the error?

Any help would be greatly appreciated.

Bing

Sep 27 '05 #1
4 15677
du****@gmail.co m wrote:

[snip]

A runtime error has occurred. Do you wish to debug? Line:188
Error: Object required

The line reporting error is:

div.style.displ ay = (div.style.disp lay == 'block') ? "none" : "block";


[snip]

Try:
div.style.displ ay=div.style.di splay=="none"?" ":"none";

Mick
Sep 27 '05 #2
On Tue, 27 Sep 2005 14:24:52 GMT, Mick White
<mw***********@ rochester.rr.co m> wrote:
Try:
div.style.displ ay=div.style.di splay=="none"?" ":"none";
Mick,

is above short for something else? if yes, could you please spell it
out?!

Thanks

Geoff



Mick


Sep 27 '05 #3
Geoff Cox wrote:
On Tue, 27 Sep 2005 14:24:52 GMT, Mick White
<mw***********@ rochester.rr.co m> wrote:

Try:
div.style.displ ay=div.style.di splay=="none"?" ":"none";

Mick,

is above short for something else? if yes, could you please spell it
out?!

Google: "ternary operator", or "conditiona l operator".
Mick
Sep 27 '05 #4
On Tue, 27 Sep 2005 18:35:08 GMT, Mick White
<mw***********@ rochester.rr.co m> wrote:
Geoff Cox wrote:
On Tue, 27 Sep 2005 14:24:52 GMT, Mick White
<mw***********@ rochester.rr.co m> wrote:

Try:
div.style.displ ay=div.style.di splay=="none"?" ":"none";

Mick,

is above short for something else? if yes, could you please spell it
out?!

Google: "ternary operator", or "conditiona l operator".


Thanks MIck,

Geoff


Mick


Sep 27 '05 #5

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

Similar topics

1
8960
by: Carolyn Speakman | last post by:
Hi, I'm trying to amend an intranet .asp page but keep getting this error. The error only occurs when I pull the WHOLE intranet off the server and try to run it locally. The error isn't there when the page is run off the intranet server. I'm using IIS 5, I.E. 6 and WinXP Pro. Here's the code it doesn't like:
4
4114
by: Geoff Cox | last post by:
Hello, One person to date has received a runtime error message saying "parent.frameleft.location is not an object" with the following code. The code is used to select 2 frames at the same time... Any ideas why please? Geoff
0
4402
by: ann | last post by:
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to handle events from the html input buttons. In the client-side script, I am calling the ActiveX control object to perform some job. The problem is: when I run the application and click on the button (which fires the event), I get a runtime error: Microsoft VBScript runtime error: Object required:...
0
755
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. The same code works fine in a standalone app. I have inspected System.Runtime.Remoting.dll with ildasm, and I can see the ....Channels.Http namespace there. I verified that the virtual directory is configured to use v2.0.50727 (the error message...
0
1569
by: Yong | last post by:
I have a COM DLL written in C++ which worked fine when called from VB6. But we have now moved to Visual Studio 2005 - .NET Framework v2 and Windows XP Pro. In total there are 4 methods in this DLL which I can call, 3 of which have no return paramters as arguments (ByRef), these work fine, its only the method that uses 2 passed in paramters (Long - ByRef) to return the the required data that causes an exception. So from my VB.NET program:...
1
6057
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while during the runtime, the user can click on a button and change the connection string without exiting the application. I would really appreciate any sort of help.
4
8841
by: Genken | last post by:
Hi can anybody help me i get this error when running this code. Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' And then a line number indicating where the error is, i cant see any errors with this code please assist. Thanks in advance. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
1
2575
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript" src="../Scripts/calender.js"></script> </HEAD> <body bgColor="white" MS_POSITIONING="GridLayout"> <form id="Form1" style="LEFT: 0px; POSITION: absolute; TOP: 0px" method="post" runat="server"> <!--<table width="100%" style="LEFT: 0px; POSITION:...
4
3223
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form With Me! DoCmd.Requery
0
8612
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
9171
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...
0
8880
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...
1
6532
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
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...
1
3053
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 we have to send another system
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.