java scrip messes up page centering

hi i have this feature coded in java script that only works if i remove the doc type deceleration from my web page this is fine in firefox as my web page is still centered but in Internet explorer it messes up the web page centering. can any one advise me what i can do to fix this?
Who is Participating?
helpchrisplzAuthor Commented:
what i had to do is just edit the doctype like this:


IE needed a doctype to center the website
but firefox was not likeing the full doctype so the edited one works with both browsers and also now my java script is working :)
Run the javascript through JSLint.

This is an amazing tool which will analyse your JavaScript and tell you how to clean up the code. Using this tool ends up generating code that is compatible across browsers.

As for doctype errors, there's a chance that your errors are coming from how you are linking in the JavaScript into your page not being compatible with the doctype used. I suggest looking at W3Schools DOCTYPE for more information.
helpchrisplzAuthor Commented:
this is needed for the scrip to work and i think its the reason its messing up with the doctype

<body onLoad="javascript:attach_file( 'mysql_insert.php' ) ; show_status('Ready...'); "> <!--atach my php file so its ready for later -->
helpchrisplzAuthor Commented:
i am currently using this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
helpchrisplzAuthor Commented:
i found the solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.