开发者

How to scan HTML and javascript files for cross browser compatability?

开发者 https://www.devze.com 2023-01-02 08:53 出处:网络
I\'m looking for a tool that will scan my HTML and JS files and report whether the scripts are cross browser compatible or not. I\'m not really interested in an online tool which I have to enter all m

I'm looking for a tool that will scan my HTML and JS files and report whether the scripts are cross browser compatible or not. I'm not really interested in an online tool which I have to enter all my开发者_如何学编程 URL's.


There may be some "scanners" around but none of them is going to do a decent, complete job - whether things behave well across browsers one will have to confirm visually, using human eyes.

The best you can do in terms of automatic testing, in my opinion, is create valid HTML. It won't guarantee proper rendering, but it's a first step into the direction and will save you from many problems.


You're not going to find such a tool unfortunately - if it existed, the person who made it would be able to pretty much charge whatever they liked for it and would be adored by web developers the world over!

In seriousness though, you can find tools such as W3C's HTML and CSS validators, but you will still have issues as different browsers do different things when presented with even the most valid standards-compliant markup. Valid markup does not mean it will look right, after all. You will often have problems with older browsers in this respect (read up on 'quirks mode' and 'standards mode').

Ensuring that the pages look the same in all browsers is quite hard, short of actually using each browser on each OS or platform you will not find a reliable way to do this automatically. I do believe that there are some tools out there to give you screenshots of a page loaded under various browsers, however I have heard they can be slow and aren't that brilliant.

As for JavaScript, all the browsers have their little quirks with it I have found. Even when using a framework such as jQuery or Prototype, you will still have issues which can only be found by trying the page out yourself and seeing if it does what you expect it to.

In essence, what I'm trying to say is that 'cross-browser support' is highly subjective and cannot be tested using an automated tool. Only you know what to expect from each page, which browsers are doing things 'right' and which ones aren't. This includes all aspects of the page, from HTML and CSS through to JavaScript.

I suspect that you really want a quick fix solution with minimal effort required, but you won't get it. You need to spend your own time and a lot of effort making sure your site looks and acts right across all the browsers you wish to support. No-one else will do it for you.


http://browsershots.org/ This websites uses different browsers and takes screenshots for you so will show you visually what it looks like for js i think you would have to actually test it.

0

精彩评论

暂无评论...
验证码 换一张
取 消