Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com
I've done quite a few web UI changes, including CSS styles and javascript testing in IE. Now I have to  ensure, that it also work in FioreFox.
The suggested  Collection of Global CSS Reset Styles not always work , if site has already some default style settings.
I also incorrectly used parentElement in DOM - always use parentNode instead.
innerText
Thanks to Damian Edwards who pointed another FireFox incompatibility bug in our javascript code:
The line in javascript causing the issue easily figured out using Firebug.
 The elem.innerText property is an IE proprietary addition and thus not usually supported by other browsers. Instead you should be getting the “inner text” of the cell using something like the following:

elem.firstChild.nodeValue;

This uses W3C DOM compliant properties to retrieve the text value of the first TextNode of the cell. This makes it more likely to work across browsers.

 
Width in IE and Firefox   treated differently.
According to standard (that FireFox follows), content width is set excluding paddings and border(see figure there).
"The size of the box is the sum of the element width (i.e. formatted text or image) and the padding, the border and the margin areas".

But in IE the width of the box is the width of the content plus any border or padding.
In other words:
width(IE)="padding-left"+"border-left"+ width(FF) + "padding-right"+"border--right".
To make IE to follow standard can be done by specifying
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
Unfortunately, this change will have MAJOR impact on existing web site. In our application we effectively have one page with different user controls loaded dynamically, so the change will effect everything -too risky.
Class and ID Names are Case Sensitive in FireFox
IE is not case sensitive, when you search by ID.  If your  script is working in IE, but not if FF, check that the IDs are written consistently.
More tips can be found in Adrian Anttila's post JavaScript differences in Firefox and Internet Explorer  
Different Tools.
For IE I mentioned some tools in my older post Tools to debug/Trace ASP.NET applications.
Posted on Wednesday, February 13, 2008 10:54 PM CSS/DHTML/JavaScript | Back to top


Comments on this post: Differences in Internet Explorer and FireFox CSS and Javascript

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
I just wanted to say thanks, as the doctype line actually fixed a page that was bugging me - it displayed perfectly in firefox but had odd spacing in IE.
Left by Metroid48 on Dec 28, 2008 4:40 AM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
I'm having trouble with firefox reading my truncated blog posts (www.artstarblog.com). IE and safari work great.

Firefox will pull the flash from the original posts and put them on the "homepage" in random locations.

Any ideas?

Thanks!
Cody
Left by Cody on Sep 08, 2009 11:10 AM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
what is the difference between ie and firefix in the case of css and html
plese give me information about this problem
Left by hari krishna adhikri on Jan 15, 2010 7:37 AM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
I have a question. My host is JustHost and built my site with RV Site Builders, all in WYSIWYG. I don't know coding. They did something with Java I believe. Now the site is ruined. In Firefox even the menu is not visible and is 6-inch wide. When I try to put my cursor on the page, sometimes the pages jumps away instead to editing. Everything is a mess - and a different mess in each browsers. However, when I go into HTML source I never get the full HTPM (it's in PhP) and anything I inserted there even if I learn where and what, it does not have any effect. Do you have any idea of what are my options - including if it helps taking my site to another host or what?
Left by Elena on Oct 27, 2010 8:52 PM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
Firefox and Mozilla are the biggest internet browsers on the market, with Chrome coming from behind. However, I don`t like IE at all because of many reasons, starting from speed and finishing with internet security. The best things about browsers are that they are free to use and you can choose what to use and which browser suits you best.
Left by Business Security Software on Mar 05, 2011 9:15 AM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
Until today I don't need it for my website but I think for the future I need to apply it to my web.
Left by riple on Jan 11, 2012 10:34 PM

# re: Differences in Internet Explorer and FireFox CSS and Javascript
Requesting Gravatar...
This big problem for me as other web designer.
microsoft ...big prob.
Left by tel çit on May 10, 2012 6:44 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net