如何调试移动设备上的网站? [英] How to debug web sites on mobile devices?

查看:190
本文介绍了如何调试移动设备上的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人们如何在移动设备上调试网站?



我希望能够操纵HTML和CSS,类似于在桌面浏览器中使用Inspector,并调试JavaScript。

解决方案

我最近遇到与我正在开发的移动网站相同的问题。我发现最好的解决方案是使用Safari的UserAgent设置为Iphone(确保您已启用Safari的开发人员工具)。您必须检测到用户来自移动设备,并将其重定向到您的移动网址或加载移动特定的样式表,因为此方法无法设置css媒体类型。



Firefox也具有此功能,但不注册webkit css样式(我认为您将使用它们,因为它们适用于Mobile Safari和Android) / p>

您将遇到桌面浏览器与实际移动浏览器之间的一些不一致之处,但是快速识别样式和JavaScript调试工作就像一个魅力。



希望有帮助。


How do people debug websites on mobile devices?

I'd like to be able to manipulate the HTML and CSS similar to using the Inspector in a desktop browser, and debug JavaScript.

解决方案

I recently ran into the same issue with a mobile site I was developing for work. The best solution I found was to use Safari's UserAgent set to Iphone (make sure you have Safari's developer tools enabled). You will have to detect that the user is coming from a mobile device and either redirect them to your mobile url or load the mobile specific stylesheets, as this method doesn't work setting the css media type.

Firefox has this capability as well, but doesn't register webkit css styles (which I assume you will be using as they work for both Mobile Safari and Android).

You will run into a few inconsistencies between your desktop browser and your actual mobile browser, but for quickly identifying styles and javascript debugging it worked like a charm.

Hope this helps.

这篇关于如何调试移动设备上的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆