473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Mac Compatibility

Here's a quickie, and I would eternally grateful if one of you could
explain why the following works on browsers on windows but does not
seem to on Macs ?

You may find it easier to go to http://www.ced.ltd.uk - the code is
for the header menu.

Also, will the rem-ed out "window.screen.availWidth" bit work on a mac
?

Many thanks for any assistance !

David

<Style>
A {font-size=14}
</Style>
<Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR>

<TD>
<Span Style=cursor:hand>
<Script Language=JavaScript>
s='<Area Shape=Rect Target=Show Coords=';l=64;w=59;h=22;img='800600';
//if (window.screen.availWidth>800) {l=84;w=77;h=22;img='';}
document.write('<Img Src=Menu'+img+'.png Border=0 Usemap=#map><Map
Name=Map>');
document.write(s+(l*0)+',0,'+(l*0+w)+','+h+' href=Products.php
Title="Online Product Brochure Browser, Searcher and Datasheets">');
document.write(s+(l*1)+',0,'+(l*1+w)+','+h+'
href=SuppliesWeb.php?spwCategory=16 Title="Online Project Exhibition
and Searcher">');
document.write(s+(l*2)+',0,'+(l*2+w)+','+h+' href=Resources.htm
Title="Useful Documents and Resources for Downloading or Printing">');
document.write(s+(l*3)+',0,'+(l*3+w)+','+h+' href=Contact.htm
Title="Contact Details for different CED Depots">');
document.write(s+(l*4)+',0,'+(l*4+w)+','+h+' href=Brochure.htm
Title="Request a Brochure in the Post">');
document.write(s+(l*5)+',0,'+(l*5+w)+','+h+' href=Ced.htm
Title="Description of CED and its History">');
//document.write(s+(l*6)+',0,'+(l*6+w)+','+h+"
OnClick=self.open('Glossary.php','','toolbar=0,men ubar=0,location=0,resizable=yes,width=600,height=3 00,scrollbars=yes')
Title='Search a Glossary of Terms and Definitions'>");
//document.write(s+(l*7)+',0,'+(l*7+w)+','+h+' href=MenuFull.htm
Title="Help and Expanded Menu">');
document.write(s+(l*6)+',0,'+(l*6+w)+','+h+' href=MenuFull.htm
Title="Help and Expanded Menu">');
document.write('</Map>');
</Script>
</Span>
</TD>

<TD Align=Right>
<B><I><Small>CED for all your Natural Stone</Small></I></B> &nbsp;
<A HRef=Home.htm Target=Show><Img Src=Ced-Green.png Width=40 Height=40
Align=Center Border=0 Title="CED Ltd"></A>
</TD>

</TR></Table>
Jul 23 '05 #1
4 1390
me*********@hotmail.com (Mesmeric) writes:
Here's a quickie, and I would eternally grateful if one of you could
explain why the following works on browsers on windows but does not
seem to on Macs ?
Which browsers on Windows? Which browsers on Mac? Have you tried
Mozilla on both platforms? Opera 7? Or is it just IE on Windows
vs. Safari on Mac?

I don't have a Mac available, so I'll just do some educated guessing.
You may find it easier to go to http://www.ced.ltd.uk - the code is
for the header menu.
Indeed, it seems to work fine in Opera 7 and IE 6 on Windows (from
my guess at what it is supposed to do).
Also, will the rem-ed out "window.screen.availWidth" bit work on a mac
?
No idea, sorry. What is it supposed to do?
<Style>
First of all, make your HTML validate! Read this:
<URL:http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you>

The style tag requires the "type" attribute, so this should be
<style type="text/css">
A {font-size=14}
And validate your CSS. This should be a ":", not a "=":
a { font-size: 14; }
</Style>
Your style tag is placed inside the body of the page. That is also
illegal HTML, and reason enough for a browser to ignore it.
<Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR>
While I suggest using CSS for styling instead of attributes like
these, it will work. However, the attribute value for Width contains a
percentage mark, and should be quoted:
width="100%"
The rules for when an attribute value needs to be quoted and when it
doesn't are hard to remember. If you quote everything, or just
everything containing a non-letter/non-digit character, then you can't
go wrong.
<TD>
<Span Style=cursor:hand>
<Script Language=JavaScript>
The script tag requres the "type" attribute. It is also sufficient,
so just use:
<script type="text/javascript">
s='<Area Shape=Rect Target=Show Coords=';l=64;w=59;h=22;img='800600';


This is *hard* to read. I can't see any errors in it though. And as
you say, it works in some browsers.

You have not told us *how* it fails to work in you Mac browser.
Is the <map> element written at all? (You can test that by checking
the innerHTML property of the body element, e.g., using this bookmarklet:

javascript:document.body.innerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br>")

(the line should *not* be broken. If it is, your news client has mangled it)
Show the menu page in the browser and enter the above in the address
bar (or make a bookmark with it). Then the actual HTML of the page should
be shown ("View Source" only shows the original source, not what happens
after the document.write's).
And why don't you just use buttons instead of an image of buttons?
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2
Thanks for your quick reply regarding the source for the menu bar on
http://www.ced.ltd.uk

By it working on Windows, I mean all the browsers available on my PC,
which include
Internet Explorer 6.0, Mozilla Firefox 0.9.2, Opera 7.51, Netscape 7.1

I don't know what browsers are failing on Mac, I merely have had
feedback that many Mac users have difficulty - like yourself, I have
no Mac available !
I gather that when you click on the menu, nothing happens.

javascript:alert(window.frames(0).document.body.in nerHTML)
correctly shows the Map tagging. I did notice a discrepancy in the
capitalisation of the Map name and its UseMap reference - would that
perhaps explain the problem? or even that I called the Map name 'Map'.

The reason for the image menu is that when the buttons are fixed, they
can be made more stylised.
The window.screen.availWidth was for using a larger image for screens
with a greater width in pixels. I rem-ed it out whilst studying this
problem.

Thanks for your comments about being keeping HTML valid - it's always
a helpful reminder. Much of it comes down to the fact that design is
ongoing into the site, and in quickly copying and pasting one can
inadvertently misplace a paste through too cursory a look, or it's
easier to type a short tag just to get the testing right - so I'll be
going through carefully when it is really final. The comments about
quotes was certainly useful.

Anyone of you guys out there own a Mac, who could help ?

david
------------------------------------------------------------------
Menubar Code in question (modified) :

<Html>
<Head>
<Style Type="text/css">
A {font-size:14}
</Style>
</Head>
<Body BGColor=#e0ffff VLink=#000080 ALink=#ff0000
Background=BackgroundMenu.png>
<Table Border=0 CellSpacing=0 CellPadding=0 Width="100%"><TR>

<TD>
<Span Style=cursor:hand>
<Script Language=JavaScript>
s='<Area Shape=Rect Target=Show Coords=';l=64;w=59;h=22;img='800600';
//if (window.screen.availWidth>800) {l=84;w=77;h=22;img='';}
document.write(
'<Img Src=Menu'+img+'.png Border=0 Usemap=#Map><Map Name=Map>'
+s+(l*0)+',0,'+(l*0+w)+','+h+' href=Products.php Title="Online Product
Brochure Browser, Searcher and Datasheets">'
+s+(l*1)+',0,'+(l*1+w)+','+h+' href=SuppliesWeb.php?spwCategory=16
Title="Online Project Exhibition and Searcher">'
+s+(l*2)+',0,'+(l*2+w)+','+h+' href=Resources.htm Title="Useful
Documents and Resources for Downloading or Printing">'
+s+(l*3)+',0,'+(l*3+w)+','+h+' href=Contact.htm Title="Contact Details
for different CED Depots">'
+s+(l*4)+',0,'+(l*4+w)+','+h+' href=Brochure.htm Title="Request a
Brochure in the Post">'
+s+(l*5)+',0,'+(l*5+w)+','+h+' href=Ced.htm Title="Description of CED
and its History">'
//+s+(l*6)+',0,'+(l*6+w)+','+h+"
OnClick=self.open('Glossary.php','','toolbar=0,men ubar=0,location=0,resizable=yes,width=600,height=3 00,scrollbars=yes')
Title='Search a Glossary of Terms and Definitions'>"
//+s+(l*7)+',0,'+(l*7+w)+','+h+' href=MenuFull.htm Title="Help and
Expanded Menu">'
+s+(l*6)+',0,'+(l*6+w)+','+h+' href=MenuFull.htm Title="Help and
Expanded Menu">'
+'</Map>');
</Script>
</Span>
</TD>

<TD Align=Right>
<A HRef=MenuAlt.htm><Font Color=#000000 Size=-2>Alternative
Menu</Font></A> &nbsp; &nbsp; &nbsp;
<B><I><Small>CED for all your Natural Stone</Small></I></B> &nbsp;
<A HRef=Home.htm Target=Show><Img Src=Ced-Green.png Width=40 Height=40
Align=Center Border=0 Title="CED Ltd"></A>
</TD>

</TR></Table>

</Body></Html>
Jul 23 '05 #3
me*********@hotmail.com (Mesmeric) writes:
I did notice a discrepancy in the capitalisation of the Map name and
its UseMap reference - would that perhaps explain the problem?
It's a reasonable guess. I would expect names and id's to be case
esensitive.
or even that I called the Map name 'Map'.
Probably not. There is no global variable named "Map" (especially with
a capital "M"), but it can't hurt to change it to something more
informative.
The reason for the image menu is that when the buttons are fixed, they
can be made more stylised.
Yes, but you are also using a solution that depends on javascript, and
where normal links could do the same and work in all browsers. That is
unnecessarily fragile.

With CSS, you can style the links to look like buttons, or in many
other fancy ways.
Thanks for your comments about being keeping HTML valid - it's always
a helpful reminder.


:)
And remember the DOCTYPE declaration. It's required for valid HTML
at least since version 2.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
Lasse Reichstein Nielsen wrote:
me*********@hotmail.com (Mesmeric) writes:
[...]
<Style>


First of all, make your HTML validate! Read this:
<URL:http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you>

The style tag requires the "type" attribute, so this should be
<style type="text/css">


s/tag/element/
A {font-size=14}


And validate your CSS. This should be a ":", not a "=":
a { font-size: 14; }


And that number *must* be followed by a unit (as it is not zero). Since
"px" was intended but that unit is not suited for the screen due to
differences in font resolution, the number should be reduced and "px"
or "em" should be used. Probably 1.2em is what the OP is looking for.
<Script Language=JavaScript>


The script tag requres the "type" attribute.


Again, it is the "script" _element_ that requires that attribute.
The element consists of a _start tag_ where that attribute must
be set, its content (specified by the content model definition
in the DTD, that is, the type(s) of data this element may contain)
and the matching _end tag_.
PointedEars
Jul 23 '05 #5

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

Similar topics

6
by: someone | last post by:
Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run...
5
by: someone | last post by:
Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run...
14
by: frostalicious | last post by:
Used VB.NET (on my client PC) to convert VB6 executable to .NET executable. Placed the .exe file on a network drive on my server. From client, ran .NET Wizards "Trust an Assembly" to make the...
6
by: someone | last post by:
Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run...
2
by: Carlo | last post by:
I recently started in a new position, and I inherited an application written in VB6 that uses a bunch of DLLs and OCX controls. Version Compatibility is set to Binary at the project level, but since...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.