Javascript

Joined
Nov 18, 2006
Messages
640
Reaction score
0
im trying to make my site Firefox or opera or netscape only
IE tears it apart visually
i used this code
Code:
<script language="javascript">
if(navigator.appName=="Microsoft Internet Explorer")
{document.location ="REJECT";}else{document.location="REAL PAGE";}
</script>
im not Javascript genuis so i need help when ie loads it goesa black then continues to the site
is the code incomplete???
 
For more information about the browser detection with JavaScript please read the following page.

JavaScript - Browser detect

Just a advice, if your customers are using a browser which makes your site look messy either fix your site or just give them a notice it works best in firefox. Blocking people because their browser is 'wrong' is propably not a good option
 
I don't think he really cares whether you do that or not lol...

I suggest atleast making 2 pages: one that looks correct for ie and one that looks correct for ffox. That or fix up your page to work with both lol
 
I don't think he really cares whether you do that or not lol...

I suggest atleast making 2 pages: one that looks correct for ie and one that looks correct for ffox. That or fix up your page to work with both lol

i dont care bout username1's opinion
IE is infererior IMO
it dosent read HTML/XHTML/CSS tags that others do so i code the page for safari oper or firefox users.
so im gonna make the page FF safari or opera only
so im gonna work on the coding with JS and make it work
 
You're wrong. IE does read those tags, if you write valid HTML. If you do not, you're an idiot because about 80% of people on the internet use IE so you limit yourself to a very small number of people. In fact, IE tends to read -more- tags then FF and Opera, as it is less strict, so I'm guessing you probably used a wrong doctype, didn't specify one at all, or are just plain clueless. It is ridiculously easy to write a site that looks the same in FireFox and IE, so if you can't do it you probably should look for another profession anyway.

As for your code, your browser detection is flawed, see YukiNeko post on how to do it correctly.
 
You're wrong. IE does read those tags, if you write valid HTML. If you do not, you're an idiot because about 80% of people on the internet use IE so you limit yourself to a very small number of people. In fact, IE tends to read -more- tags then FF and Opera, as it is less strict, so I'm guessing you probably used a wrong doctype, didn't specify one at all, or are just plain clueless. It is ridiculously easy to write a site that looks the same in FireFox and IE, so if you can't do it you probably should look for another profession anyway.

As for your code, your browser detection is flawed, see YukiNeko post on how to do it correctly.
im saying that it dosent read some ags that i use frequently and when i validate i have 8 errors in my script most are thins i cant find wrong with in the code mind having a look at it?
 
oops sorry fragfrog when i looked at my site in IE it was in IE6 ( maybe its update time..)
and bout the errors ill PM you them im not at my home PC so i dont have acess to the final cut of it
 
ie6 or not you can still make a site that looks the same in all browsers
Just like you there are people with a lower version of ie out there lol

Usually if there's a script that just won't align right in ie or in ffox I usually put it in a browser check and load another working one in each instance.
Floating divs seem to have the problem a lot lol

But I am having the same problem right now as well lol
Some stuff just doesn't look the same in ie as in ffox lol, but I'm too lazy to fix it
 
ok now im having a few errors in the Wc3 check
Below are the results of attempting to parse this document with an SGML parser.

1. Error Line 38 column 44: there is no attribute "MARGINHEIGHT".

...id="Table_01"width="800"marginheight="762" border="0"cellpadding="0"cellspaci

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.


2. Error Line 38 column 90: document type does not allow element "TABLE" here.

...der="0"cellpadding="0"cellspacing="0">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


3. Error Line 44 column 44: there is no attribute "BACKGROUND".

... height="135" colspan="4" background="http://forum.ragezone.com/images/Untitled-1_03.png"><div align="c


4. Error Line 83 column 6: end tag for "TABLE" omitted, but its declaration does not permit this.

</html>

* You forgot to close a tag, or
* you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.

The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.


5. Info Line 38 column 0: start tag was here.

<table id="Table_01"width="800"marginheight="762" border="0"cellpadding="0"cells

6. Error Line 83 column 6: end tag for "HTML" which is not finished.

</html>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
]
i had to get rid of
Code:
<div align="center">
how can i get this into css to make the page centered?
 
Back