jQuery核心之 $
1、$(document).ready() 和 $(document).load() 的 区别:
<!-- Another way to put jQuery into no-conflict mode. --><script src="prototype.js"></script><script src="jquery.js"></script><script>jQuery.noConflict();jQuery( document ).ready(function( $ ) {// You can use the locally-scoped $ in here as an alias to jQuery.$( "div" ).hide();});// The $ variable in the global scope has the prototype.js meaning.window.onload = function(){var mainDiv = $( "main" );}</script>
<!-- Loading jQuery before other libraries. --><script src="jquery.js"></script><script src="prototype.js"></script><script>// Use full jQuery function name to reference jQuery.jQuery( document ).ready(function() {jQuery( "div" ).hide();});// Use the $ variable as defined in prototype.jswindow.onload = function() {var mainDiv = $( "main" );};</script>
<script src="prototype.js"></script><script src="jquery.js"></script><script>// Give $ back to prototype.js; create new alias to jQuery.var $jq = jQuery.noConflict();</script>
<!-- Using the $ inside an immediately-invoked function expression. --><script src="prototype.js"></script><script src="jquery.js"></script><script>jQuery.noConflict();(function( $ ) {// Your jQuery code here, using the $})( jQuery );</script>
<script src="jquery.js"></script><script src="prototype.js"></script><script>jQuery(document).ready(function( $ ) {// Your jQuery code here, using $ to refer to jQuery.});</script>
<script src="jquery.js"></script><script src="prototype.js"></script><script>jQuery(function($){// Your jQuery code here, using the $});</script>
jQuery核心之 $的更多相关文章
- Jquery核心函数
在Jquery中,所有的DOM对象都将封装成Jquery对象,而且只有Jquery对象才能使用Jquery方法或者属性来执行相应的操作. 所以Jquery提供了一个可以将DOM对象封装成Jquery对 ...
- jquery 核心
1.jquery核心函数 1.1 jQuery([selector,[context]]); $("#id"),$(document.body),$(" ...
- JQuery --- 第一期 (初识jQuery, JQuery核心函数和工具方法)
个人学习笔记 初识jQuery 1.我的第一个JQuery <!DOCTYPE html> <html lang="en"> <head> & ...
- Jq_DOM元素方法跟JQuery 核心函数跟JQuery 事件方法
JQuery DOM 元素 函数 描述 .get() 从队列中删除所有未运行的项目. .ind ...
- 13.11.20 jquery 核心 siblings() 获得同类(不包含自己)循环所有,
jquery 核心1.选择器,2. 创建dom 元素 3. jquery 执行时 4. 延迟执行 5. 循环 6. 计算长度.7.8 获得选择器和所在节点 9. 获得下标 10. 元素存放数据 11 ...
- jQuery笔记: 基本概念与jQuery核心
目录 初识jQuery 为什么要使用jQuery? 如何使用jQuery? jQuery与js加载模式不同 jQuery入口函数的四种写法 jQuery的访问符冲突问题 jQuery核心函数和jQue ...
- jQuery核心函数和静态方法
jQuery核心函数 从jQuery文档中可以看出,jQuery核心函数一共3大类4小类 jQuery(callback) 当DOM加载完成后执行传入的回调函数 <script> $(fu ...
- 浅谈 jQuery 核心架构设计
jQuery对于大家而言并不陌生,因此关于它是什么以及它的作用,在这里我就不多言了,而本篇文章的目的是想通过对源码简单的分析来讨论 jQuery 的核心架构设计,以及jQuery 是如何利用javas ...
- jquery核心功能分析
作者:zccst 核心功能包括: jQuery是如何定义的,如何调用的,如何扩展的.掌握核心方法是如何实现的,是理解jQuery源码的关键.这里理解了一切豁然开朗. 1,如何定义,即入口 // Def ...
- 谈一谈jQuery核心架构设计(转)
jQuery对于大家而言并不陌生,因此关于它是什么以及它的作用,在这里我就不多言了,而本篇文章的目的是想通过对源码简单的分析来讨论 jQuery 的核心架构设计,以及jQuery 是如何利用javas ...
随机推荐
- P1073 最优贸易
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; int head1[maxn], head2[ ...
- AspNet Mvc 路由解析中添加.html 等后缀 出现404错误的解决办法
使用Mvc 有时候我们希望,浏览地址以.html .htm 等后缀名进行结尾. 于是我们就在RouteConfig 中修改路由配置信息,修改后的代码如下 routes.IgnoreRoute(&quo ...
- 一个php的爬虫,将笔趣阁的书可以都下载下来。
数据库:book 表id ---- 数据库: `book`-- -- -------------------------------------------------------- ---- 表的结 ...
- ECSHOP 用户中心 我的订单前台显视订单每张商品图片及收货人
先在网站根目录打开文件 includes/lib_transaction.php 查找代码 $sql = "SELECT order_id, order_sn, order_status, ...
- Oracle的Connect By理解
connect by中的条件就表示了父子之间的连接关系 比如 connect by id=prior pid,但如果connect by中的条件没有表示记录之间的父子关系那会出现什么情况? 常见的,c ...
- mac上卸载oracle jdk 1.8.0_31
mac上卸载oracle jdk 1.8.0_31版本,因为版本太高了.得安装旧版本才行.卸载的顺序是:进入finder,然后点应用程序,按command+向上箭头键,分别进入根目录的系统与资源库找到 ...
- Oracle 小案例
create database cstd; use cstd; /*1:建立学生表*/ create table student ( 学号 ) primary key, 姓名 ), 性别 ), 年龄 ...
- react input 获取/失去焦点
<div className={ this.state.focus ? "dis_bottom_left_onfocus" : "dis_bottom_left&q ...
- cat *.txt | grep '>' | wc -l
find the line where the '>' located, and make a statistic.
- 用Unity开发HTC VIVE——移动漫游篇
这篇文章主要写的是通过手柄控制移动在场景中漫游.在通过手柄控制移动时,我主要写了两个脚本一个ChildTransform.cs.Move.cs;1. ChildTransform这个脚本主要是为了获取 ...