[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

java scrip messes up page centering

Posted on 2011-03-20
5
Medium Priority
?
332 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

649 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