Link to home
Start Free TrialLog in
Avatar of snjkrva
snjkrva

asked on

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
Avatar of DreamMaster
DreamMaster

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.
Avatar of snjkrva

ASKER

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
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.
Avatar of snjkrva

ASKER

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

Max.
Avatar of snjkrva

ASKER

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
Avatar of snjkrva

ASKER

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
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...
Avatar of snjkrva

ASKER

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

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&
ASKER CERTIFIED SOLUTION
Avatar of DreamMaster
DreamMaster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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&
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator