jQuery使用总结 - Core jQuery 其他 4/4

简介: Core jQuery使用中其要注意的一些知识点 Events $('img').bind('click',function(event){alert('Hi there!');});         $(function(){         $('#example')           .

Core jQuery使用中其要注意的一些知识点

Events

$('img').bind('click',function(event){alert('Hi there!');});

 

      $(function(){

        $('#example')

          .bind('click',function(event) {

          say('BOOM once!');

          })

          .bind('click',function(event) {

            say('BOOM twice!');

          })

          .bind('click',function(event) {

            say('BOOM three times!');

          });

      });

 

$('.whatever').bind({

  click: function(event) { /* handle clicks */ },

  mouseenter: function(event) { /* handle mouseenters */ },

  mouseleave: function(event) { /* handle mouseleaves */ }

});

 

注意.live的使用

 

在“jQuery 1.4.1 Cheat Sheet.chm”事件节有例子

Effect

处理元素的显示效果

有 基本显示、滑动、淡入淡出、字定义

在“jQuery 1.4.1 Cheat Sheet.chm”说明

Utility Functions

函数名都是jQuery. 即$. 开头

有以下类别:浏览器及特性检测、数组和对象操作、函数操作、测试操作、字符串操作、URL

在“jQuery 1.4.1 Cheat Sheet.chm”工具节

 

$.browser.version

$.merge( [0,1,2], [2,3,4] )

$.isArray([])

$.trim("  hello, how are you?  ");

 

var params = { width:1680, height:1050 };

var str = jQuery.param(params);

$("#results").text(str);

AJAX

$.ajax({

   type: "POST",

   url: "some.php",

   data: "name=John&location=Boston",

   success: function(msg){

     alert( "Data Saved: " + msg );

   }

});

 

var html = $.ajax({

  url: "some.php",

  async: false

 }).responseText

 

$.getJSON("test.js", function(json){
  alert("JSON Data: " + json.users[3].name);
});

 

关于jquery使用的其他3个内容点参考:

http://www.cnblogs.com/2018/archive/2010/10/12/1849238.html

http://www.cnblogs.com/2018/archive/2010/10/13/1849981.html

http://www.cnblogs.com/2018/archive/2010/10/13/1849982.html

 

相关文章
|
JavaScript 算法 前端开发
jQuery第二天,笔记总结(二)
jQuery第二天,笔记总结(二)
92 0
jQuery第二天,笔记总结(二)
|
移动开发 缓存 JavaScript
jQuery第二天,笔记总结(一)
jQuery第二天,笔记总结
83 0
jQuery第二天,笔记总结(一)
|
JavaScript 前端开发
jQuery第一天,笔记总结(二)
jQuery第一天,笔记总结(二)
141 0
jQuery第一天,笔记总结(二)
|
存储 JavaScript 前端开发
jQuery第一天,笔记总结(一)
jQuery第一天,笔记总结
145 0
jQuery第一天,笔记总结(一)
|
JavaScript
jquery的使用-4
jquery的使用-4
59 0
jquery的使用-4
|
缓存 移动开发 JavaScript
【前端3分钟】高效使用jQuery
【前端3分钟】高效使用jQuery
|
JavaScript 前端开发
jQuery中的一些基本操作总结
jQuery中的一些基本操作总结
121 0
jQuery中的一些基本操作总结
|
JavaScript 数据安全/隐私保护 索引
jQuery选择器总结(选择器+元素筛选)
jQuery选择器总结(选择器+元素筛选)
208 0
|
JavaScript
jquery获取第几个元素的方法总结
jquery获取第几个元素的方法总结
340 0
|
JavaScript
《锋利的jquery》认识jquery总结
《锋利的jquery》认识jquery总结
86 0