Solved

Problem with MAC

Posted on 2002-03-06
13
145 Views
Last Modified: 2010-04-09
Hi Guys,
I have got a problem while testing with MAC. We have code which works in NT (IE 4 and above, NS 4 and above) but same thing does not work in MAC (IE and NS above 4). Works only for IE 4 and NS 4 in MAC...

Here is the code:
function jsfShowAlert(alertName)
{
     var browser = navigator.appName;
     var version = parseInt(navigator.appVersion);
     var ns4 = (document.layers)? true:false;
     var ie4 = (document.all)? true:false;    
     if (ns4) document.layers["customerownedalert"].visibility = "show";
     else if (ie4) document.all.customerownedalert.style.visibility = "visible";
}

function jsfHideAlert(alertName)
{    
     var browser = navigator.appName;
     var version = parseInt(navigator.appVersion);
     var ns4 = (document.layers)? true:false;
     var ie4 = (document.all)? true:false;    
     if (ns4) document.layers["customerownedalert"].visibility = "hide";
    else if (ie4) document.all.customerownedalert.style.visibility = "hidden";
}


Any help to make it work for MAC as well as NT above IE4 and NS4

thanks in advance!
Sanjeev
0
Comment
Question by:snjkrva
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6846751
Hmm...all you are trying to do is show or hide a layer right?

Anyway, I do not see the variable "alerName" coming back in the rest of the functions..not that it has to matter...

Try using these functions if you can:

function showLayer(ALayerName)
{
  if (ALayerName != "")
  {  
    (document.layers) ? eval("document." + ALayerName + ".visibility = 'show'") : eval("document.all['" + ALayerName + "'].style.visibility = 'visible'");
  }
}

function hideLayer(ALayerName)
{
  if (ALayerName != "")
  {
    (document.layers) ? eval("document." + ALayerName + ".visibility = 'hide'") : eval("document.all['" + ALayerName + "'].style.visibility = 'hidden'");
  }
}

They always work for me on both Macintosh and PC...

Max.
0
 

Author Comment

by:snjkrva
ID: 6847547
Hi DreamMaster,
I don't see anything different than what i pasted...except that you have eval function.
Please tell me if this code works in ie, ns 4+ in mac...
we tested and it works in nt though.

regards,
snjkrva
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6847588
This one is the one my company uses all the time and it works with all versions 4 and up...on both windows NT and Mac platforms... :)

Max.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:snjkrva
ID: 6848690
Hi DreamMaster,
I don't see anything different than what i pasted...except that you have eval function.
Please tell me if this code works in ie, ns 4+ in mac...
we tested and it works in nt though.

regards,
snjkrva
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6848696
Please next time hit "reload question" at the top of the page it saves a comment.. :)

Max.
0
 

Author Comment

by:snjkrva
ID: 6851448
Hi DreamMaster,
I don't see anything different than what i pasted...except that you have eval function.
Please tell me if this code works in ie, ns 4+ in mac...
we tested and it works in nt though.

regards,
snjkrva
0
 

Author Comment

by:snjkrva
ID: 6851758
DreamMaster, your solutions works in MAC for Netscape...I still dont see in IE....i know code looks simple but is there any reason IE in MAC doesnt like Dynamic HTML at all?

thanks for giving your time,
snjkrva
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6852021
On the Macintosh, IE sucks, and even Netscape is better, but it should work on IE on the Macintosh as well...could you show the code you are using exactly so I can check this myself?

Max.

P.S. Could be that you would have to wait until monday until I can check it...it is weekend and I do not have a Mac available at home...I might be able to see it from the code alone though...
0
 

Author Comment

by:snjkrva
ID: 6880778
Hi DreamMaster,
Our 'div' tag is not working in IE, MAC. If you have sample code which has div tag inside the table and then code to show and hide the layer, that will help.

thanks in advance
snjkrva

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6975491
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Cd&
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 50 total points
ID: 6977064
Using DIVs inside tables could very well be your problem, still...to fix it, I would need to see your code...

As far as I can tell I gave you all sorts of help and didn't ask for the code for no reason. The functions I provided you with are very general and work in IN and NS on both PC and Max. I have been using them for a long time.

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7065556
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to DreamMaster

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7066746
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML - Color not displaying correctly in EMAIL. 6 49
Scroll 5 news at a time. 4 33
Save ms data to server side. 19 55
Alert after MVC form submitted 1 22
This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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…

856 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