• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

Problem with MAC

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
snjkrva
Asked:
snjkrva
  • 5
  • 5
  • 2
  • +1
1 Solution
 
DreamMasterCommented:
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
 
snjkrvaAuthor Commented:
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
 
DreamMasterCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
snjkrvaAuthor Commented:
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
 
DreamMasterCommented:
Please next time hit "reload question" at the top of the page it saves a comment.. :)

Max.
0
 
snjkrvaAuthor Commented:
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
 
snjkrvaAuthor Commented:
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
 
DreamMasterCommented:
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
 
snjkrvaAuthor Commented:
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
 
COBOLdinosaurCommented:
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
 
DreamMasterCommented:
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
 
COBOLdinosaurCommented:
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
 
MoondancerCommented:
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now