将jQuery添加到sublime文本2

将jQuery添加到sublime文本2

本文介绍了将jQuery添加到sublime文本2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jQuery世界的新手,今天才开始使用sublime text 2.因此,我不知道我必须下载哪些软件包以及如何下载。所以,如果有人知道如何在我的sublime text 2编辑器中添加jQuery来使用它,我会请求。如果你能给我一步一步的指示,那将是很棒的,就像我说我是新手一样。另外,如何获取jQuery的选择列表。

I am new to jQuery world, and only today started using sublime text 2. Therefore, I am not aware of what packages I have to download and how to download. So, I would kindly request if anyone know how do I add jQuery to use it in my sublime text 2 editor. It will be great if you can give me a step by step instructions, like I said I am new to this. Also, how to get list of selections for jQuery.

任何帮助都会非常感激。谢谢:]

Any help would be greatly appreciate it. Thanks :]

推荐答案

jQuery是一个JS库。要使用它,您需要将其包含在您的文档中,如:

jQuery is a JS library. To use it you need to include it in your document like:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

你可以操纵你的DOM元素/事件做这样疯狂的事情:

Than you'll be able to manipulate your DOM elements/events doing crazy stuff like this:

<script>
    $(function(){
        $('body').prepend('HELLO EVERYONE!');
    });
</script>

或类似

帮助您完成工作Sublime通过创建快捷方式片段轻松包含该jQuery库的可能性,我将向您展示如何:

To help you in your work Sublime has a possibility to easily include that jQuery library by creating a shortcut snippet, I'll show you how:

<snippet>
<content><![CDATA[
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
]]></content>
<tabTrigger>jquery</tabTrigger> <!-- the text that using [Tab] will paste the snippet -->
</snippet>

>

Documents And Settings / yourUserName / Application Data / Sublime Text 2 / Packages / User /

jquery.sublime-snippet

重新启动Sublime类型 jquery +点击键,jQuery库代码段将包含在您的文档中。

Restart Sublime type jquery + hit your key and the jQuery library snippet will be included in your document.

以同样的方式创建自己一遍又一遍使用的片段,例如

The same way you can create your own snippets that you use over and over for example like

$(function(){

});



var intv = setInterval(function(){

}, 1000 );

这篇关于将jQuery添加到sublime文本2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 18:03