Solved

Display property error

Posted on 2006-06-21
6
728 Views
Last Modified: 2007-12-19
Hi guys,

I'm working on adding a feature to hide rows of a table in one of my web applications, and get this error on page load:

Error: Could not get display property. Invalid argument.

this is my function:

function InspectorShowHide(displaySetting) {
      document.getElementById("insRowinspectorID").style.display = displaySetting;
      document.getElementById("insRowinspectorWidth").style.display = displaySetting;
      document.getElementById("insRowinspectorHeight").style.display = displaySetting;
      document.getElementById("insRowinspectorLatitude").style.display = displaySetting;
      document.getElementById("insRowinspectorLongitude").style.display = displaySetting;
      document.getElementById("insRowinspectorZIndex").style.display = displaySetting;
}

and it is being called on the:

<body onload="InsectorShowHide('hide');">

Any ideas how to get past this error?


Cheers!
0
Comment
Question by:Cyber-Drugs
  • 4
6 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
ID: 16953738
Hi Cyber-Drugs,

It is:

display:none
visibility:hidden

;-)

Regards,
Ted
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 16953748
I am really not with it today am I? Lol, thanks again Ted!
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 16953752
Cyber-Drugs,

In fact, to toggle, you would do:

InspectorShowHide('none');

and

InspectorShowHide('');

assuming of course InspectorShowHide is spelled correctly.

Ted
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 36

Expert Comment

by:Zyloch
ID: 16953756
Cyber-Drugs,

No problem, it's just one of those days, eh?

Ted
0
 
LVL 18

Expert Comment

by:Morcalavin
ID: 16953758
Use 'none' instead of 'hide'
'block' will make the elements visible again,
'inline' will also make them visisble, but in a different manner.
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 16953777
Yep, exactly, and there are other ones too, such as inline-block and table, for instance. Setting it to blank will revert the object to its default display setting, be it block, inline, or table, etc.

Ted
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now