?
Solved

java scrip messes up page centering

Posted on 2011-03-20
5
Medium Priority
?
330 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:helpchrisplz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 6

Expert Comment

by:GregArnott
ID: 35177499
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.
0
 
LVL 1

Author Comment

by:helpchrisplz
ID: 35177522
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 -->
0
 
LVL 1

Author Comment

by:helpchrisplz
ID: 35177528
i am currently using this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
0
 
LVL 1

Accepted Solution

by:
helpchrisplz earned 0 total points
ID: 35177806
what i had to do is just edit the doctype like this:

<!DOCTYPE HTML PUBLIC >

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 :)
0
 
LVL 1

Author Closing Comment

by:helpchrisplz
ID: 35213375
i found the solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

762 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