简体   繁体   English

移植Web应用程序以在IE7中工作

[英]Porting a web application to work in IE7

I'm developing a web application that uses lots of Javascript and CSS, both of my own creation and through third-party libraries. 我正在开发一个使用自己的创作以及通过第三方库使用大量Javascript和CSS的Web应用程序。 These include jQuery and Google Maps & Visualization JS APIs. 这些包括jQuery和Google Maps&Visualization JS API。

I've been testing everything in Firefox 3. Things are peachy until it turns out the main target of this webapp is ( cue sad trombone ) IE7. 我一直在测试Firefox 3中的所有功能。直到事实证明此web应用程序的主要目标是IE7( 提示性长号 ),事情才能如愿以偿。 I'm looking for caveats, advice, libraries, or other references to help make this transition as easy as possible (not that it's actually going to be easy). 我正在寻找警告,建议,库或其他参考,以帮助使这种过渡尽可能地容易(并不是说实际上会很容易)。

I've already tried IE7.js though it hasn't yet shown itself to be the silver bullet I was hoping for. 我已经尝试过IE7.js,尽管它尚未显示出我所希望的银弹。 I'm sure that it works as advertised, I think it's just not as all-encompassing as I'd like (example: colors like #4684EE and #DC3912, which are correctly rendered in FF3, are rendered as black in IE7, with or without IE7.js). 我确信它可以像广告中所说的那样工作,我认为它并没有我想要的那么全面(例如:正确地在FF3中呈现的#4684EE和#DC3912之类的颜色在IE7中呈现为黑色,或没有IE7.js)。 Are there other libraries out there to help bring IE7 (more) in line with FF3? 是否有其他库可以帮助使IE7(更多)与FF3保持一致?

A corollary question: what debugger would you recommend for IE7? 一个必然的问题:对于IE7,您会推荐哪种调试器? I'm currently using Firebug Lite, but it runs painfully slowly. 我目前正在使用Firebug Lite,但运行缓慢。 Is there anything out there with similar features that I might have missed? 有没有我可能会错过的类似功能?

As far as libraries go, jQuery is compatible across all major browsers, so at least you've got that going for you. 就库而言,jQuery在所有主流浏览器上都是兼容的,因此至少您已经拥有了它。 Without knowing exactly which plugins/modules/libraries you're using, I can't recommend alternatives that are cross-browser compatible. 在不确切知道您使用的是哪个插件/模块/库的情况下,我无法推荐跨浏览器兼容的替代方案。

You could take a look at the Internet Explorer Developer Toolbar . 您可以查看Internet Explorer开发人员工具栏 It isn't nearly as good as Firebug, but it's better than nothing . 它几乎不像Firebug好,但是总比没有好

Get the IETab add-on for Firefox so that you can fire up IE right inside the same tab you test Firefox in. Get the FULL version of Firebug. 获取Firefox的IETab附加组件,以便您可以在测试Firefox的同一选项卡中直接启动IE。获取完整版的Firebug。 It will be perfect for you to deal with HTML, CSS, and scripting. 非常适合处理HTML,CSS和脚本。 HTMLValidator for validating your HTML and CSS. HTMLValidator用于验证HTML和CSS。 The Web Developer toolbar is a MUST if you don't have it. 如果没有Web Developer工具栏,则必须使用它。 I can't even go into a fraction of the benefits it has, from images to source viewing to validating scripts it has a lot. 从图像到源代码查看再到验证脚本,我什至都无法享受它的诸多优势。

I use a separate stylesheet for IE7. 我为IE7使用了单独的样式表。 It doesn't have many changes from the original stylesheet, but enough to make viewing in IE7 close to FF. 它与原始样式表相比没有太多更改,但足以使IE7中的视图接近FF。 I try not to do ANYTHING for IE6. 我尝试不对IE6做任何事情。 In fact I encourage the "downfall" of IE6. 实际上,我鼓励IE6的“失败”。 It's almost ten years old, and full of bugs, and unsupported now! 它已经将近十年了,并且充满了错误,并且现在不被支持!

Unfortunately, Microsoft doesn't really want to be on the same page as the W3C and developers that want web standards so that you don't have deal with what you're going through right now. 不幸的是,Microsoft确实不希望与W3C和需要Web标准的开发人员在同一页面上,以便您不必处理当前正在经历的事情。 Regardless of what they SAY, they're still "competing" against the other browsers for control, and it's hurting the developers. 不管他们怎么说,他们仍然在与其他浏览器争夺控制权,这正在伤害开发人员。

Writing cross browser code is a big topic - you can't really generalize it into "don't float left and padding-left" statements and be done. 编写跨浏览器代码是一个大话题-您不能真正将其概括为“不要向左浮动和向左填充”语句并完成。

Separate stylesheets for ie are messy and not needed IMO. IE的单独样式表比较混乱,不需要IMO。

Generally speaking, firefox fixes broken code in a good bit of cases, so there is a chance that at least some of your stuff looks bad in IE because of open tags that firefox is fixing for you. 一般来说,firefox会在很多情况下修复损坏的代码,因此,由于Firefox会为您修复的开放标签,因此至少有一些东西在IE中看起来很糟糕。

Re-slicing a site that's already done might be your easiest way. 重新切片已完成的网站可能是最简单的方法。 You should be able to completely redo the CSS from scratch in a few hours tops. 您应该能够在几小时内从头开始完全重做CSS。

But all this is advice that may not apply - it would be easier to see the code you're talking about. 但是所有这些都是可能不适用的建议-可以更轻松地看到您正在谈论的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM