473,769 Members | 6,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bug with firefox

I needed to hide and show som DIV sections,

There are many scripts on the net for this. I downloaded that allows
me to open a hidden DIV from inside a DIV than is itself hidden. This
accomplished I was pleased with my work.

That was until I saw the mess in Firefox which ignores everything I
tell it to do and opens all the DIVs regardless on load. Forgetting
the browser war jargon as to why Firefox would release a program that
doesn't work with common code I just need a way of doing this so it
works in Firefox AND MSIE and anything else out there.

function InsertContentme d(tid) {
if (
document.getEle mentById(tid).s tyle.display == "none") {
document.getEle mentById(tid).s tyle.display = "";
document.regfrm s.cgfnm.focus() ;
}
else {
document.getEle mentById(tid).s tyle.display = "none";
}
}

I am opening and closing a hidden DIV with a click call. (It opens it
when it is closed and it closes it when it is open, The other standard
way of doing this does not work for me as I need this to work from
withing a parent DIV that is itself opened by another Javascript
function.

Any and all help greatly appreciated

Garry Jones
Sweden
Aug 31 '08 #1
11 1142
Solved!

I was having trouble earlier when I wrote this code so I changed a
couple of <DIVtags to <ptags. It was these that were faulting.

Firefox does not allow <ptags to have a [ style="display: none" ]
component. Strange but true, when turned back to DIV it works
perfectly (even on MSIE). I dread to see my site on other browsers but
know I must......

Sorry to have disturbed you good people.....

However, a wider issue and OT but these differing Internet browsers
are a headache, rather like a country allowing people to drive on the
left and ride side of the road at the same time. I dont care which one
but wouldn't life be jollier if all the companies making browsers bar
one gave up and deleted their products? What's the point of more than
one?

Cheers
Garry Jones
Sweden
Aug 31 '08 #2
GarryJones wrote:
Solved!
It only seems so. You have merely found a workaround to the problem as
caused by the insufficient analysis of it.
I was having trouble earlier when I wrote this code so I changed a couple
of <DIVtags to <ptags. It was these that were faulting.
Unlikely. Chances are that <http://validator.w3.or g/would have shown
nesting errors.
Firefox does not allow <ptags to have a [ style="display: none" ]
component.
Nonsense.
Strange but true, when turned back to DIV it works perfectly (even on
MSIE).
Which would indicate instead that either your markup or your script so far
is of poor quality, for <p style="display: none">...</pworks fine in my Fx
3.0.1 and all other CSS-capable UAs.
Sorry to have disturbed you good people.....
Don't be sorry for *that*.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Sep 1 '08 #3
Firefox does not allow <ptags to have a [ style="display: none" ]
component.

Nonsense.
I agree with PointedEars. This claim is completely untrue. I wrote
the
following program and it works perfectly on all browsers I tested it
on.

...
<head>
...
<script type="text/javascript" language="JavaS cript">
function toggle_containe r(id)
{
var container = document.getEle mentById(id);
container.style .display = (container.styl e.display == "")
? "none" : "";
}
</script>
</head>
<body>
...
<a href="javascrip t:void(0);"
onclick="toggle _container('som e_text');">Togg le</a>
<p id="some_text" style="display: ;">Hello there</p>
...
</body>
...

Strange but true, when turned back to DIV it works perfectly (even on
MSIE).

Which would indicate instead that either your markup or your script so far
is of poor quality, for <p style="display: none">...</pworks fine in my Fx
3.0.1 and all other CSS-capable UAs.
I'd like to add that I checked this code on IE(5,6,7,8b) and
Firefox(infancy-3.0),
after all, checking for browser compatibility is kinda part of my job.
Sep 1 '08 #4
On Aug 31, 11:39 pm, GarryJones <mor...@algonet .sewrote:
However, a wider issue and OT but these differing Internet browsers
are a headache, rather like a country allowing people to drive on the
left and ride side of the road at the same time. I dont care which one
but wouldn't life be jollier if all the companies making browsers bar
one gave up and deleted their products? What's the point of more than
one?
No it wouldn't. Especially if the one that remains was IE.

Cheers
Steve Young
Austria

Sep 1 '08 #5
Arun wrote:
^^^^^^^^^^^
You are encouraged to shorten the attribution line to ease reading, but
please do not remove it.
>>Firefox does not allow <ptags to have a [ style="display: none" ]
component.
Nonsense.

I agree with PointedEars. This claim is completely untrue. I wrote
the following program and it works perfectly on all browsers I tested
it on.
Even though it is error-prone and invalid ;-)
[...]
<script type="text/javascript" language="JavaS cript">
^^^^^^^^^^^^^^^ ^^^^^^
The `language' attribute is deprecated and unnecessary nowadays.
[...]
<a href="javascrip t:void(0);"
^^^^^^^^^^^^^^^ ^^^^
You should not do that, see <http://jibbering.com/faq/#FAQ4_24>.
onclick="toggle _container('som e_text');">Togg le</a>
^
There is where the `return' statement belongs.
<p id="some_text" style="display: ;">Hello there</p>
^^^^^^^^^
There you may have syntactically Valid markup, but not Valid CSS;
in a CSS property declaration, the property value is *required*.

<http://jigsaw.w3.org/css-validator/>
HTH

PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Sep 1 '08 #6
On Sep 2, 4:03*am, Steve <stephen.jo...@ googlemail.comw rote:
On Aug 31, 11:39 pm, GarryJones <mor...@algonet .sewrote:
However, a wider issue and OT but these differing Internet browsers
are a headache, rather like a country allowing people to drive on the
left and ride side of the road at the same time. I dont care which one
but wouldn't life be jollier if all the companies making browsers bar
one gave up and deleted their products? What's the point of more than
one?

No it wouldn't. Especially if the one that remains was IE.
Actually quite a few people think it would. Which is why there are
efforts to embed Mozilla in IE:

http://www.iol.ie/~locka/mozilla/control.htm

So now you can use xpath in IE -- HA!
Sep 1 '08 #7
SAM
GarryJones a écrit :
>
Firefox does not allow <ptags to have a [ style="display: none" ]
That's new ?

My Fx.3 accepts this attribute with div or p
Sep 1 '08 #8
On Sep 2, 12:49 am, slebetman <slebet...@gmai l.comwrote:
On Sep 2, 4:03 am, Steve <stephen.jo...@ googlemail.comw rote:
On Aug 31, 11:39 pm, GarryJones <mor...@algonet .sewrote:
However, a wider issue and OT but these differing Internet browsers
are a headache, rather like a country allowing people to drive on the
left and ride side of the road at the same time. I dont care which one
but wouldn't life be jollier if all the companies making browsers bar
one gave up and deleted their products? What's the point of more than
one?
No it wouldn't. Especially if the one that remains was IE.

Actually quite a few people think it would. Which is why there are
efforts to embed Mozilla in IE:
There now exist ecmaScript and W3C DOM standards. Yet even though
Microsoft sit on these committees they still do not implement these
standards in IE when the don't feel like it. That is the main cause of
your browser problem.

If there was a sports competition where one side made up it's own
rules as it went along, would it be fair to disqualify all of the
other teams that play by the agreed rules?

Regards, Steve.

Sep 2 '08 #9
Thomas 'PointedEars' Lahn <PointedE...@we b.dewrote:
Even though it is error-prone and invalid ;-)
I agree that the code is error-prone but is sufficient as an example.
*<script type="text/javascript" language="JavaS cript">

* * * * * * * * * * * * * * * * * ^^^^^^^^^^^^^^^ ^^^^^^
The `language' attribute is deprecated and unnecessary nowadays.
Because the `language' attribute is deprecated, it doesn't mean that
it
might not work. It is mainly there for backward compatibility. People
still
use browsers that can not evaluate MIME-types in attribute values.
>
[...]
*<a href="javascrip t:void(0);"

* * * * * * ^^^^^^^^^^^^^^^ ^^^^
You should not do that, see <http://jibbering.com/faq/#FAQ4_24>.
onclick="toggle _container('som e_text');">Togg le</a>

^
There is where the `return' statement belongs.
Thanks for the link. I never knew all that stuff. I'll be sure to
clean up my act in days to come.

Thanks again,
Arun
Sep 2 '08 #10

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

Similar topics

3
9292
by: Jeremy Epstein | last post by:
I've got a 4-page form that lets users enter a whole lot of information, which is then submitted and emailed at the end. All the fields are stored as session data. The whole thing works fine: 1. On my local box (WinXP / Apache2 / PHP4) using IE6 2. On my local box using Firefox1 3. On my hosted server (RHLinux / Apache1.3 / PHP4) using IE6
6
5029
by: Geoff | last post by:
When trying to focus a field in Firefox, I get the following error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: file:///C:/Documents%20and%20Settings/Edd/Desktop/test.html :: valText :: line 24" data: no] Source File: file:///C:/Documents%20and%20Settings/Edd/Desktop/test.html Line: 24 Anyone have any ideas as to why this is happening?
87
9628
by: expertware | last post by:
Dear friends, My name is Pamela, I know little about CSS, but I would like to ask a question I have an image on a web page within a css layer: <DIV ID=MyLayer STYLE = "position: absolute;top:68px; left:563px; width:640px;height:480px;"> <IMG src="ReportImageBox_12.54.52.png" width=640 height=480></IMG>
14
2327
by: expertware | last post by:
Ok! to avoid confusion I will start a new argument. Thanks!! FIREFOX 1.0.7 AND IE6 viewed through DATATIME: a summary REPORT =============================================================== by Pamela Datatime Team -----------------
5
3119
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>> webbrowser.open("http://www.python.org") It does not throw an exception, but is not able to launch a browser.
7
9616
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script language="JavaScript"> var cntlName; var eleTarget = document.getElementById('hiding'); function showOrHide(){
12
1776
by: amit | last post by:
Hello group, I'm kinda skeptical about a code is being used in my js program. All it does is checking what browser is being run and finds out if FLASH is installed or not. This code works just fine withe IE but as far as Firefox I'm not sure. Using the firefox I can see flash pages easily but when this code says firefox is not installed in my firefox!!!
6
5833
by: scotty | last post by:
I have a script that loops through an existing table list and prepares each href element node to trigger a function when an image is clicked. The function that will be run passes a property value to the function upon clicking. The property value is one of the attributes defined for each respective href in the property list. In IE and Netscape, the property values pass correctly, but in Firefox, only the last property value in the list...
7
2538
by: Carlos Mendonça | last post by:
Has anyone managed to get ClickOnce to work with Firefox? It seems to me that it still has the same issues VS 2K5 had. I appreciate any comments or tips.
3
2433
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a couple of the Firefox is munging up. So, on my information page there is a gridview in the content section of the page. The masterpage contains searching capabilities for the gridview. The masterpage has controls contained in a panel control,...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9999
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
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
7413
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
6675
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
5310
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
3967
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
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.