问题
I am new to development. I want to know that how we can manage the cross browser compatiability problems. for example some times it happens that same code is working with firefox but not with IE. I had an issue that one of my code of downlao
回答1:
Whenever anyone says they have "cross browser issues", they almost always mean "it doesn't work in IE". Frequently, the developer uses IE as their reference for how things work which is the worst thing they could do since IE is 13 years behind all other browsers in modern standards and compliance and inept at best.
Therefore, always use a modern browser (anything but IE) to initially test your markup. Along with validation of HTML and CSS, this will make your code work everywhere in most cases. Then you know your code is written correctly. As you go along, look in IE to see how it screws everything up but the quirks and bugs of IE are well known, as are the hacks to fix it.
Never, ever trust IE to do anything right. Do NOT fall for the fallacy that IE9 will be any savior either.
回答2:
there are 2 possibilities when it comes to cross-compatibility:
- handle cross-compatibility by yourself -> this is almost impossible for non-experts (keep in mind that you have to know how every browser is interpreting HTML/CSS/JS)
- use a javascript library like:
- JQuery
- prototype/scriptaculous
- Dojo
- etc.
the library will handle cross-compatibility ;)
回答3:
for IE u can use this little technique..:
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="file.css"/>
<![endif]-->
it was given out by microsoft...it worked for me!
来源:https://stackoverflow.com/questions/4836737/how-to-manage-cross-browser-compatibility-issues