热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

哪些编码约定可以帮助jQuery和Firebug一起工作?-WhatcodingconventionsthathelpjQueryandFirebugworktogether?

ImfairlynewtobothtoolsandneedtogohardcorewithbothasImanage,monitor,andtweakanew

I'm fairly new to both tools and need to go hardcore with both as I manage, monitor, and tweak a new site's design process. What sort of strategies should I ask be implemented that sets a good solid foundation for debugging, testing, and logging?

我对这两种工具都很熟悉,在管理、监视和调整新站点的设计过程时,都需要使用hardcore。要实现什么样的策略,才能为调试、测试和日志记录打下良好的基础?

[to the degree that back-end stuff can play a role - it's .net mvc thx

[从某种程度上说,后端内容可以发挥作用——它是。net mvc thx

6 个解决方案

#1


1  

First off make sure you've read Firebug's docs. Some of the commands work cross-brower with other tools as well.

首先,确保你读过Firebug的文档。有些命令也可以与其他工具进行交叉浏览。

A simple search query will show you all available extensions for Firebug. As some people mentioned - some of them are really helpful.

一个简单的搜索查询将显示所有可用的Firebug扩展。就像有些人提到的,有些是很有帮助的。

Also it's important not to limit yourself to just a single tool since you will most likely be developing for multiple browsers. So make sure you take a look at webkits developer tools (Safari, Chrome) as well. Here's a good article which sums up the most popular development/debug tools.

同样重要的是不要把自己局限在一个工具上,因为您很可能要为多个浏览器开发。所以一定要看看webkit开发工具(Safari, Chrome)。这里有一篇很好的文章总结了最流行的开发/调试工具。

You might want to research how jQuery/jQuery plugins are structured/organized so you have general idea how to organise your own Javascript/jQuery code. It all depends how Javascript heavy is your application. If jQuery just provides some visual enhancements and few Ajaxified pages here and there, don't bother. From other hand if it's very Javascript heavy (as in a lot more site logic on client-side then on backend) I would suggest Prototype over jQuery, but it's just my opinion.

您可能想要研究jQuery/jQuery插件的结构/组织方式,以便了解如何组织自己的Javascript/jQuery代码。这一切都取决于你的应用程序Javascript有多繁重。如果jQuery只是提供了一些视觉增强,并且这里和那里几乎没有Ajaxified页面,那么就不用麻烦了。另一方面,如果Javascript很重(在客户端和后端站点逻辑中),我建议使用jQuery原型,但这只是我的看法。

You could consider using automatic tools to build your Javascript if you have a lot of code. For example:

如果您有很多代码,可以考虑使用自动工具构建Javascript。例如:

  • Sprockets
  • 链轮
  • Juicer
  • 榨汁机

On production server you want to end up with as few Javascript files as possible and make sure to compress em.

在生产服务器上,您希望使用尽可能少的Javascript文件,并确保压缩em。

If you're interested in more links to articles/tools for Javascript heavy applications, drop a comment. I'm just trying to stay on topic at the moment.

如果您对Javascript重应用程序的文章/工具的更多链接感兴趣,请发表评论。我只是想暂时停留在这个话题上。

#2


4  

I would use Firebug to see how things are working with a few Firebug Add-ons.

我将使用Firebug查看如何处理一些Firebug附加组件。

I would use YSlow to check that you aren't downloading too much and it will make suggestions if you aren't minifying and gzipping your Javascript.

我将使用YSlow来检查您没有下载太多,如果您没有缩小和gzipping Javascript,它将提供建议。

I would also use FireQuery as that highlights jQuery very nicely in Firebug. I use it quite a lot these days to see what it should be firing.

我还将使用FireQuery,因为它在Firebug中很好地突出了jQuery。这些天我经常用它来看看应该发射什么。

Firebug doesn't rewrite XHRequests anymore but there is a bug in the latest Firefox/Firebug where if can block long running XHR calls. Details here

Firebug不再重写xhrequest,但是在最新的Firefox/Firebug中有一个bug,如果可以阻塞长时间运行的XHR调用。细节

#3


1  

I would just give a small warning using FireBug's network monitor and AJAX together. When enabled, it rewrites some HTTP headers and breaks stuff badly (well it used too, not sure anymore).

我将使用FireBug的网络监视器和AJAX发出一个小警告。当启用时,它会重写一些HTTP头文件并将其破坏得很糟糕(它也使用得很好,不再确定)。

So if anything goes ape. Check that network monitoring is disabled.

所以如果发生了什么事。检查网络监控是否被禁用。

#4


1  

I will also add for tools FireCOOKIE, as it goes very well with $.COOKIE.

我还将添加工具FireCOOKIE,因为它与$.COOKIE很匹配。

When I am debugging jQuery code I am using the NET panel a lot in Firebug for all ajax requests. Very helpful to see what are you sending and what are you receiving.

当我调试jQuery代码时,我在所有ajax请求中都经常使用NET面板。很有帮助,看你发送什么和你收到什么。

Also I use a lot the comand line, to test snippets of code.

我还经常使用comand行来测试代码片段。

You cannot do without the console. It will be very helpful. Example:

你离不开控制台。这将非常有帮助。例子:

$.get( 'url.php', {}, 
    function(data){
        $.each(data, function(x){
            console.log( x ); // will log each x object to see what it contains
        });
    }, 'json'
);

#5


0  

I also suggest you install FireUnit addon. It helps you work with QUnit unit tests. Of course that is if you are planning to write unit tests but in most cases that's the very good idea.

我也建议你安装FireUnit addon。它可以帮助您处理QUnit单元测试。当然,如果你打算写单元测试,但在大多数情况下,这是一个很好的主意。

#6


0  

As much as you might love Firebug, Safari's developer tools are also quite powerful, and worth checking out. It's all I use when I dev.

尽管您可能非常喜欢Firebug,但Safari的开发工具也非常强大,值得一试。这就是我在开发时使用的所有东西。

Worth mentioning that Safari's Javascript engine is still faster than FFX's, while Chrome reigns supreme. They're playing catch-up though, so this really isn't worth caring about.

值得一提的是,Safari的Javascript引擎仍然比FFX的要快,而Chrome是至高无上的。他们在追赶,所以这真的不值得关注。


推荐阅读
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 本文介绍了Java工具类库Hutool,该工具包封装了对文件、流、加密解密、转码、正则、线程、XML等JDK方法的封装,并提供了各种Util工具类。同时,还介绍了Hutool的组件,包括动态代理、布隆过滤、缓存、定时任务等功能。该工具包可以简化Java代码,提高开发效率。 ... [详细]
  • javascript  – 概述在Firefox上无法正常工作
    我试图提出一些自定义大纲,以达到一些Web可访问性建议.但我不能用Firefox制作.这就是它在Chrome上的外观:而那个图标实际上是一个锚点.在Firefox上,它只概述了整个 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法
    本文介绍了解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法,包括检查location配置是否正确、pass_proxy是否需要加“/”等。同时,还介绍了修改nginx的error.log日志级别为debug,以便查看详细日志信息。 ... [详细]
  • 本文讨论了在VMWARE5.1的虚拟服务器Windows Server 2008R2上安装oracle 10g客户端时出现的问题,并提供了解决方法。错误日志显示了异常访问违例,通过分析日志中的问题帧,找到了解决问题的线索。文章详细介绍了解决方法,帮助读者顺利安装oracle 10g客户端。 ... [详细]
  • Nginx使用(server参数配置)
    本文介绍了Nginx的使用,重点讲解了server参数配置,包括端口号、主机名、根目录等内容。同时,还介绍了Nginx的反向代理功能。 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 目录实现效果:实现环境实现方法一:基本思路主要代码JavaScript代码总结方法二主要代码总结方法三基本思路主要代码JavaScriptHTML总结实 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • AndroidJetpackNavigation基本使用本篇主要介绍一下AndroidJetpack组件Navigation导航组件的基本使用当看到Navigation单词的时候应 ... [详细]
  • 我们使用pythonunit ... [详细]
author-avatar
哲纸
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有