Solved

More compatible website

Posted on 2004-09-14
32
247 Views
Last Modified: 2006-11-17
I have a website that i keep up in my free time http://www.paulscomputerservice.net . If you go there using a browser other than IE it will display a message, because i have found that my site doesn't work well with other browsers. I do now want this. I recommend not using IE to people all the time to fight spyware, yet my site doesn't work on anything else. I want a more compatible website that will work with FireFox, Mozilla, Slim Browser, Netscape, etc..


1) What things should i avoid?

2) why does my site only work on IE?


I think it has something to do with the menu on the left which is an include file. I actually pass the body to the page using

index.php?body=pagetoload.php

so my menu doesn't need to be an include file really. will making that static help? i use alot of css to position stuff, is that not compatible with other browsers?
0
Comment
Question by:Paul S
  • 20
  • 5
  • 4
  • +1
32 Comments
 
LVL 25

Expert Comment

by:Squinky
ID: 12062416
First rule: make sure your site passes W3C validation: validator.w3.org, for both HTML and CSS. IE6 is absolutely chock-full of bugs (as you would expect of a browser that's not been updated in over 3 years), many of which affect CSS. The main killer is the incorrect box model, for which there is a workaround. You'll find plenty of tips for cross-browser CSS development on www.alistapart.com.
0
 
LVL 1

Expert Comment

by:Nezzo
ID: 12069920
I agree with Squinky. But, I did check it out with both IE and FireFox and it all looks the same.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12071671
it looks close to the same but not exact. the problem is mostly functionality not looks. the menu won't work in netscape and has strange things on firefox. i will get the validator thing.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12071681
the validator thing said this:

Line 6, column 46: there is no attribute "TYPE"

<LINK REL="STYLESHEET" HREF="style1.css" TYPE="text/css">

what is wrong with that tag?
0
 
LVL 11

Author Comment

by:Paul S
ID: 12071801
is this a valid tag?

<div align="justify"></div>
0
 
LVL 11

Author Comment

by:Paul S
ID: 12071969
i thought there check was case sensitive so i changed the case of my code. it still says stuff is wrong when it really isn't
0
 
LVL 11

Author Comment

by:Paul S
ID: 12071977
netscape in paticular will let you click on my menu once and then it stops working, why?
0
 
LVL 25

Expert Comment

by:Squinky
ID: 12073020
I ran the validator on it too. Case sensitivity was introduced in XHTML, though it's not really case-sensitivity - the spec is that all tags and attributes should be lower case; anything else is an error.

You should not be linking to a style sheet using a link tag, but a style tag:

<style type="text/css" src="style1.css"></style>

A link tag does not need a type attribute - the server would provide a content type header when the linked item is requested.

Most of the errors it produces are down to the fact that you're using a very old HTML 3.2 DTD. Some of the features you're relying on didn't exist in HTML 3.2. Change it to HTML 4 Transitional at the very least.

Some of the other errors are down to a slight bias in the validator for XHTML which doesn't allow & to appear directly in URLs - it needs to be entity encoded as &amp; for example:

<a href="index.php?body=contactme.php&amp;PHPSESSID=2fbd00c45b1000b45b52802804b4c">

You can set PHP to use &amp; instead of & as a parameter separator in URLs in your php.ini file, for situations where PHP generates the URL for you (as above).

Problems with your menu system are not directly an HTML problem but a Javascript one. IE and NS have rather different views of the DOM, and many Javascripts will not work on both without modification.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12081722
what is DOM? i am using Dreamweaver 2004, why would it use html 3.2 instead of 4.0?
0
 
LVL 11

Author Comment

by:Paul S
ID: 12081850
i have a weird issue. when i open a page in a browser and choose view source and then save it as html. I open the file and it doesn't open right. like half the code is missing? i can see the code in the file, but when i try to open the file ti doesn't load it all.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12081859
it only happens when i view the html using dreamweavers preview button F12 which launches the browser.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12081930
i change the entire method of my menu. it uses totally different java.  i put all my css directly into the page using an include file with the css in it right between the Style tags. still doesn't work in netscape
0
 
LVL 25

Expert Comment

by:Squinky
ID: 12082487
You can change the DTD in DW by selecting the one you want in Modify -> Document DTD.

DOM is the Document Object Model, which describes how Javascript talks to objects within a web page. the DOM is a W3C standard, but (no surprise here), Microsoft have a slightly different interpretation of it from the standard.

If your page includes any PHP, loading through DW's preview will probably not work at all - PHP scripts will not be run when accessed using a file: protocol in the URL. You need to view it by uploading to a web server, then loading that page. DW's test server setup can be very useful for this. For example, CSS includes done via PHP won't work.

Aside from that, I suggest that you track down a menu script that does work in multiple browsers.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12085303
i know about server side scripting. I have a test server setup. if i change the 3.2 to a 4 in my code will that change the way browsers read the code?
0
 
LVL 1

Expert Comment

by:Nezzo
ID: 12088315
Re: if i change the 3.2 to a 4 in my code will that change the way browsers read the code?
Answer: Probably not. If you change your DTD then you must change all your code to reflect that DTD

Browser developers mostly design browsers to read Markup Language they way they think it should be read. That's why you are running into all these inconsistencies.

However, Mozilla based browsers ie. Mozilla itself and Firefox follow the W3C standards more closley. So...what i do is design a site using XHTML/CSS and I use Firefox as I go along. After I get so far along with the site I check it in other browsers to see how different it's looking. And usually all I need is a few more CSS tweaks and it's all starting to look the same.

My suggestion to you would be to follow the tutorials provided at http://www.w3schools.com/

Either use HTML 4.01 strict DTD and CSS
or
XHTML and CSS
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 11

Author Comment

by:Paul S
ID: 12092568
i will redesign my site from the ground up. but i don't know if i will ever get it to work.
0
 
LVL 25

Expert Comment

by:Squinky
ID: 12094456
DW will also change markup to match DTDs, and it doesn't do too bad a job. This applies particularly to XHTML. For use in all modern browsers, I use XHTML 1.0 strict. To specify a DTD, you must use exactly the correct syntax, and just changing the number will not work - but just get DW to generate it for you - it's only 1 menu click away.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12096388
what menu click would that be?
0
 
LVL 11

Author Comment

by:Paul S
ID: 12096842
ok i took the source code of one of my pages and ran lots of checks on it. I ran the DW validator, The DW Browser check, the W3 CSS check, and the W3 HTML check. It passes all of these tests.

here is the static HMTL page

http://www.paulscomputerservice.net/test.html

this page passes all of the tests, but won't work in Netscape! Why?
0
 
LVL 11

Author Comment

by:Paul S
ID: 12097061
i just spend more time ajusting the CSS. It still won't work. I put this page together a piece at a time. the menu on the left worked until i move the css into this file. I think it as something to do with my position use of CSS, but i don't know here.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12097077
firefox won't read it either
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12097081
Well, actually, just to clarify, it shouldn't be <style src="something.css">

You should use the <link> tag but instead of type, you'd have rel="stylesheet"

The other way would be to use
<style type="text/css">
@import url("mydocument.css")
</style>
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12097086
Also, for your <a> and <img> tags with the onmouseout, and onmouseover, I recommend moving the onmouseout and onmouseover into the <img> tag itself. Then, you can change image0.src for example into this.src
0
 
LVL 11

Author Comment

by:Paul S
ID: 12099203
will moving the mouseover and mouseout to the img tag make it work better or more standard?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12099261
Not particularly, but it makes coding a whole heck of a lot easier =)
0
 
LVL 11

Author Comment

by:Paul S
ID: 12130234
why does it make coding easier?

i am using div tags and css to position the website. i was using tables before, but somebody told me that was old school. Should i switch back to tables since it will probably be more compatible?
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12130251
No. Tables are technically more compatible but even NS4 supports CSS to some extent. Unless you're getting flooded with IE3 users, CSS is the way to go. I'm only making a small point in that putting the onmouseover and onmouseout inside the image tag would be easier if you were to move the image, since it wouldn't depend on an outer <div>. Doesn't really matter much, just a small point.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12134344
oh i see. that is neat. So nobody can really tell me why my site won't work? the first page works fine, but when the menu gets used once it stops working.
0
 
LVL 11

Author Comment

by:Paul S
ID: 12134369
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 50 total points
ID: 12138057
Ah, well, he makes a valid point in that tables have been around since the beginning, but I disagree with whatever else he said.

First of all, CSS incompatibilities are only for computer illiterate people that are still old enough to own IE3 and stupid enough not to update (probably don't have internet, in which case, it wouldn't matter anyways). Even NN4 has CSS support to some degree and IE4 definitely does. However, you can bet most people are using IE5+ or Mozilla Firefox 0.8+ or NN6+ and almost all CSS works on those.

The only major problem that is persistant in CSS is the fact that many browsers render CSS differently (primarily IE). This is why some people stay away from CSS, and is the ONLY reason that I still feel the use of tables for layout is still warranted. Once that is fixed however, what's the point of tables?
0
 
LVL 11

Author Comment

by:Paul S
ID: 12514506
thanks for the help. I avoided CSS for the layout and used it for style and effect rather than entire page positioning. CSS is just used differently in each browser like you said.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

706 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

17 Experts available now in Live!

Get 1:1 Help Now