Solved

Problem with MAC

Posted on 2002-03-06
13
142 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

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.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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…

708 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

18 Experts available now in Live!

Get 1:1 Help Now