如何获取qrcode 生成.js生成的数据

jQuery qrcode生成二维码的方法
您当前位置: &
[ 所属分类
作者 红领巾 ]
现在二维码越来越流行,很多网页都会有个二维码,扫描后可通过手机浏览。 以前做类似的项目一般是在网页上生成图片,然后把图片插入到网页。 这样做不能每个页面都生成二维码。jquery-qrcode是一个能够在浏览器端生成二维码的jquery插件。它是独立的,最小压缩之后不足4k,也没有图片下载请求。引入该类库之后,只需要一行代码,就可以很容易在web页面加上二维码。qrcode其实是通过使用jQuery实现图形渲染,画图,支持canvas()和table两种方式,可以到/jeromeetienne/jquery-qrcode获取最新的代码。如何使用1、首先在页面中加入jquery库文件和qrcode插件&script type="text/" src="jquery.js"&&/script& &script type="text/javascript" src="jquery.qrcode.min.js"&&/script&2、在页面中需要显示二维码的地方加入以下代码:&div id="code"&&/div&3、调用qrcode插件qrcode支持canvas和table两种方式进行图片渲染,默认使用canvas方式,效率最高,当然要浏览器支持html5直接调用:$('#code').qrcode("http://www."); //任意字符串高级属性:$("#code").qrcode({ render: "table", //table方式 width: 200, //宽度 height:200, //高度 text: "" //任意内容 });
本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程
转载请注明本文标题:本站链接:
分享请点击:
1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
排队的时候你会发现一个规律:另一排总是动的比较快,当你换到另一排,你会发现,你原来站的那一排就开始动的比较快了。你站的越久,越可能感觉自己是站错了排。这就是神奇的墨菲定理。所以,不让自己后悔的最好办法,就是坚持。坚持你的人生梦想,而不去张望别人并受之影响。坚信自己当下的选择,不犹疑,不浮躁,心怀梦想,务实前行!相信成功就是将别人坚持不下来的事情坚持做下去。
手机客户端
,专注代码审计及安全周边编程,转载请注明出处:http://www.codesec.net
转载文章如有侵权,请邮件 admin[at]codesec.net,下载次数:0 次
| 关键字:
Gma.QrCodeNet.Encoder
DataEncodation
InputRecognition
EncodingRegion
ErrorCorrection
Positioning
Properties
ReedSolomon
Gma.QrCodeNet.Encoding.dll[115KB]
Gma.QrCodeNet.Encoding.pdb[443KB]
Generic.baml[1KB]
DesignTimeResolveAssemblyReferencesInput.cache[6KB]
GeneratedInternalTypeHelper.g.cs[7B]
GeneratedInternalTypeHelper.g.i.cs[2KB]
Gma.QrCodeNet.Encoding.csproj.FileListAbsolute.txt[2KB]
Gma.QrCodeNet.Encoding.dll[115KB]
Gma.QrCodeNet.Encoding.g.resources[2KB]
Gma.QrCodeNet.Encoding.pdb[443KB]
Gma.QrCodeNet.Encoding_MarkupCompile.cache[281B]
Gma.QrCodeNet.Encoding_MarkupCompile.i.cache[282B]
Gma.QrCodeNet.Encoding_MarkupCompile.i.lref[265B]
Gma.QrCodeNet.Encoding_MarkupCompile.lref[263B]
DesignTimeResolveAssemblyReferencesInput.cache[6KB]
GeneratedInternalTypeHelper.g.i.cs[2KB]
Gma.QrCodeNet.Encoding_MarkupCompile.i.cache[242B]
Gma.QrCodeNet.Encoding_MarkupCompile.i.lref[197B]
Gma.QrCodeNet.Encoding.csproj.vspscc[257B]
ui-bg_flat_0_aaaaaa_40x100.png[180B]
ui-bg_flat_75_ffffff_40x100.png[178B]
ui-bg_glass_55_fbf9ee_1x400.png[120B]
ui-bg_glass_65_ffffff_1x400.png[105B]
ui-bg_glass_75_dadada_1x400.png[111B]
ui-bg_glass_75_e6e6e6_1x400.png[110B]
ui-bg_glass_95_fef1ec_1x400.png[119B]
ui-bg_highlight-soft_75_cccccc_1x100.png[101B]
ui-icons_x240.png[4KB]
ui-icons_2e83ff_256x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_cd0a0a_256x240.png[4KB]
ui-bg_flat_0_aaaaaa_40x100.png[180B]
ui-bg_flat_75_ffffff_40x100.png[178B]
ui-bg_glass_55_fbf9ee_1x400.png[120B]
ui-bg_glass_65_ffffff_1x400.png[105B]
ui-bg_glass_75_dadada_1x400.png[111B]
ui-bg_glass_75_e6e6e6_1x400.png[110B]
ui-bg_glass_95_fef1ec_1x400.png[119B]
ui-bg_highlight-soft_75_cccccc_1x100.png[101B]
ui-icons_x240.png[4KB]
ui-icons_2e83ff_256x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_cd0a0a_256x240.png[4KB]
Controllers
accent.png[528B]
bullet.png[2KB]
cancel.png[210B]
check.png[227B]
defqr.png[1KB]
heroAccent.png[572B]
mhx_r.png[1KB]
orderedList0.png[3KB]
orderedList1.png[653B]
orderedList2.png[733B]
orderedList3.png[772B]
orderedList4.png[3KB]
orderedList5.png[3KB]
orderedList6.png[3KB]
orderedList7.png[3KB]
orderedList8.png[3KB]
orderedList9.png[3KB]
plug_range.png[143B]
richtext_arrow.png[411B]
select2.png[276B]
select_file.png[1KB]
select_online.png[274B]
Gma.QrCodeNet.Encoding.dll[105KB]
Properties
UpLoadFile
Thumbs.db[38KB]
processing.gif[6KB]
uploading.gif[6KB]
Index.cshtml[29KB]
Error.cshtml[219B]
_Layout.cshtml[1KB]
_LoginPartial.cshtml[753B]
_ViewStart.cshtml[55B]
EntityFramework.resources.dll[69KB]
Microsoft.Web.WebPages.OAuth.resources.dll[12KB]
System.Net.Http.Formatting.resources.dll[19KB]
System.Web.Helpers.resources.dll[15KB]
System.Web.Http.WebHost.resources.dll[11KB]
System.Web.Http.resources.dll[25KB]
System.Web.Mvc.resources.dll[28KB]
System.Web.Optimization.resources.dll[11KB]
System.Web.Razor.resources.dll[24KB]
System.Web.WebPages.Deployment.resources.dll[12KB]
System.Web.WebPages.Razor.resources.dll[11KB]
System.Web.WebPages.resources.dll[19KB]
WebMatrix.Data.resources.dll[11KB]
WebMatrix.WebData.resources.dll[13KB]
Antlr3.Runtime.dll[103KB]
DotNetOpenAuth.AspNet.dll[39KB]
DotNetOpenAuth.Core.dll[214KB]
DotNetOpenAuth.OAuth.Consumer.dll[17KB]
DotNetOpenAuth.OAuth.dll[54KB]
DotNetOpenAuth.OpenId.RelyingParty.dll[86KB]
DotNetOpenAuth.OpenId.dll[261KB]
EntityFramework.dll[1.07MB]
Gma.QrCodeNet.Encoding.dll[115KB]
Gma.QrCodeNet.Encoding.pdb[443KB]
Microsoft.Web.Infrastructure.dll[44KB]
Microsoft.Web.WebPages.OAuth.dll[28KB]
Mono.Math.dll[28KB]
Newtonsoft.Json.dll[366KB]
Org.Mentalis.Security.Cryptography.dll[13KB]
QRCode.dll[20KB]
QRCode.pdb[35KB]
QRHelper.dll[6KB]
QRHelper.pdb[11KB]
System.Net.Http.Formatting.dll[164KB]
System.Web.Helpers.dll[135KB]
System.Web.Http.WebHost.dll[71KB]
System.Web.Http.dll[315KB]
System.Web.Mvc.dll[495KB]
System.Web.Optimization.dll[53KB]
System.Web.Razor.dll[258KB]
System.Web.WebPages.Deployment.dll[40KB]
System.Web.WebPages.Razor.dll[38KB]
System.Web.WebPages.dll[199KB]
WebGrease.dll[941KB]
WebMatrix.Data.dll[37KB]
WebMatrix.WebData.dll[73KB]
DesignTimeResolveAssemblyReferences.cache[313KB]
DesignTimeResolveAssemblyReferencesInput.cache[24KB]
QRCode.csproj.FileListAbsolute.txt[17KB]
QRCode.csprojResolveAssemblyReference.cache[194KB]
QRCode.dll[20KB]
QRCode.pdb[35KB]
TemporaryGeneratedFile_036C0B5B-D20-8F5ADCB23D92.cs[0B]
TemporaryGeneratedFile_e60-b-f7221da3dda1.cs[0B]
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs[0B]
QRCode.csproj.user[1KB]
favicon.ico[31KB]
Properties
Gma.QrCodeNet.Encoding.dll[115KB]
Gma.QrCodeNet.Encoding.pdb[443KB]
QRHelper.dll[6KB]
QRHelper.pdb[11KB]
DesignTimeResolveAssemblyReferencesInput.cache[6KB]
QRHelper.csproj.FileListAbsolute.txt[1KB]
QRHelper.csprojResolveAssemblyReference.cache[10KB]
QRHelper.dll[6KB]
QRHelper.pdb[11KB]
TemporaryGeneratedFile_036C0B5B-D20-8F5ADCB23D92.cs[0B]
TemporaryGeneratedFile_e60-b-f7221da3dda1.cs[0B]
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs[0B]
DotNetOpenAuth.AspNet.4.0.3.12153
net40-full
DotNetOpenAuth.AspNet.dll[39KB]
DotNetOpenAuth.AspNet.4.0.3.12153.nupkg[37KB]
DotNetOpenAuth.Core.4.0.3.12153
web.config.transform[1KB]
net35-full
DotNetOpenAuth.Core.dll[214KB]
net40-full
DotNetOpenAuth.Core.dll[214KB]
DotNetOpenAuth.Core.4.0.3.12153.nupkg[381KB]
DotNetOpenAuth.OAuth.Consumer.4.0.3.12153
net35-full
DotNetOpenAuth.OAuth.Consumer.dll[17KB]
net40-full
DotNetOpenAuth.OAuth.Consumer.dll[17KB]
DotNetOpenAuth.OAuth.Consumer.4.0.3.12153.nupkg[31KB]
DotNetOpenAuth.OAuth.Core.4.0.3.12153
web.config.transform[357B]
net35-full
DotNetOpenAuth.OAuth.dll[54KB]
net40-full
DotNetOpenAuth.OAuth.dll[54KB]
DotNetOpenAuth.OAuth.Core.4.0.3.12153.nupkg[87KB]
DotNetOpenAuth.OpenId.Core.4.0.3.12153
web.config.transform[2KB]
net35-full
DotNetOpenAuth.OpenId.dll[261KB]
Mono.Math.dll[28KB]
Org.Mentalis.Security.Cryptography.dll[12KB]
net40-full
DotNetOpenAuth.OpenId.dll[261KB]
Mono.Math.dll[28KB]
Org.Mentalis.Security.Cryptography.dll[13KB]
DotNetOpenAuth.OpenId.Core.4.0.3.12153.nupkg[529KB]
DotNetOpenAuth.OpenId.RelyingParty.4.0.3.12153
web.config.transform[830B]
net35-full
DotNetOpenAuth.OpenId.RelyingParty.dll[86KB]
net40-full
DotNetOpenAuth.OpenId.RelyingParty.dll[86KB]
DotNetOpenAuth.OpenId.RelyingParty.4.0.3.12153.nupkg[170KB]
EntityFramework.5.0.0
App.config.transform[209B]
Web.config.transform[209B]
EntityFramework.resources.dll[69KB]
EntityFramework.dll[1.07MB]
EntityFramework.resources.dll[69KB]
EntityFramework.dll[1.07MB]
EntityFramework.PS3.psd1[23KB]
EntityFramework.PowerShell.Utility.dll[15KB]
EntityFramework.PowerShell.dll[131KB]
EntityFramework.psd1[23KB]
EntityFramework.psm1[29KB]
init.ps1[10KB]
install.ps1[10KB]
migrate.exe[127KB]
EntityFramework.5.0.0.nupkg[1.06MB]
EntityFramework.zh-Hans.5.0.0
EntityFramework.resources.dll[69KB]
EntityFramework.resources.dll[69KB]
EntityFramework.zh-Hans.5.0.0.nupkg[140KB]
Microsoft.AspNet.Mvc.4.0.20710.0
System.Web.Mvc.resources.dll[28KB]
System.Web.Mvc.dll[495KB]
Microsoft.AspNet.Mvc.4.0.20710.0.nupkg[260KB]
Microsoft.AspNet.Mvc.zh-Hans.4.0.20710.0
System.Web.Mvc.resources.dll[28KB]
Microsoft.AspNet.Mvc.zh-Hans.4.0.20710.0.nupkg[81KB]
Microsoft.AspNet.Razor.2.0.20710.0
System.Web.Razor.resources.dll[24KB]
System.Web.Razor.dll[258KB]
Microsoft.AspNet.Razor.2.0.20710.0.nupkg[122KB]
Microsoft.AspNet.Razor.zh-Hans.2.0.20710.0
System.Web.Razor.resources.dll[24KB]
Microsoft.AspNet.Razor.zh-Hans.2.0.20710.0.nupkg[26KB]
Microsoft.AspNet.Web.Optimization.1.0.0
System.Web.Optimization.resources.dll[11KB]
System.Web.Optimization.dll[53KB]
Microsoft.AspNet.Web.Optimization.1.0.0.nupkg[29KB]
Microsoft.AspNet.Web.Optimization.zh-Hans.1.0.0
System.Web.Optimization.resources.dll[11KB]
Microsoft.AspNet.Web.Optimization.zh-Hans.1.0.0.nupkg[9KB]
Microsoft.AspNet.WebApi.4.0.20710.0
Microsoft.AspNet.WebApi.4.0.20710.0.nupkg[3KB]
Microsoft.AspNet.WebApi.Client.4.0.20710.0
System.Net.Http.Formatting.resources.dll[19KB]
System.Net.Http.Formatting.dll[164KB]
Microsoft.AspNet.WebApi.Client.4.0.20710.0.nupkg[87KB]
Microsoft.AspNet.WebApi.Client.zh-Hans.4.0.20710.0
System.Net.Http.Formatting.resources.dll[19KB]
Microsoft.AspNet.WebApi.Client.zh-Hans.4.0.20710.0.nupkg[26KB]
Microsoft.AspNet.WebApi.Core.4.0.20710.0
web.config.transform[1KB]
System.Web.Http.resources.dll[25KB]
System.Web.Http.dll[315KB]
Microsoft.AspNet.WebApi.Core.4.0.20710.0.nupkg[172KB]
Microsoft.AspNet.WebApi.Core.zh-Hans.4.0.20710.0
System.Web.Http.resources.dll[25KB]
Microsoft.AspNet.WebApi.Core.zh-Hans.4.0.20710.0.nupkg[51KB]
Microsoft.AspNet.WebApi.WebHost.4.0.20710.0
System.Web.Http.WebHost.resources.dll[11KB]
System.Web.Http.WebHost.dll[71KB]
Microsoft.AspNet.WebApi.WebHost.4.0.20710.0.nupkg[38KB]
Microsoft.AspNet.WebApi.WebHost.zh-Hans.4.0.20710.0
System.Web.Http.WebHost.resources.dll[11KB]
Microsoft.AspNet.WebApi.WebHost.zh-Hans.4.0.20710.0.nupkg[11KB]
Microsoft.AspNet.WebPages.2.0.20710.0
System.Web.Helpers.resources.dll[15KB]
System.Web.WebPages.Deployment.resources.dll[12KB]
System.Web.WebPages.Razor.resources.dll[11KB]
System.Web.WebPages.resources.dll[19KB]
System.Web.Helpers.dll[135KB]
System.Web.WebPages.Deployment.dll[40KB]
System.Web.WebPages.Razor.dll[38KB]
System.Web.WebPages.dll[199KB]
Microsoft.AspNet.WebPages.2.0.20710.0.nupkg[214KB]
Microsoft.AspNet.WebPages.Data.2.0.20710.0
WebMatrix.Data.resources.dll[11KB]
WebMatrix.Data.dll[37KB]
Microsoft.AspNet.WebPages.Data.2.0.20710.0.nupkg[23KB]
Microsoft.AspNet.WebPages.Data.zh-Hans.2.0.20710.0
WebMatrix.Data.resources.dll[11KB]
Microsoft.AspNet.WebPages.Data.zh-Hans.2.0.20710.0.nupkg[11KB]
Microsoft.AspNet.WebPages.OAuth.2.0.20710.0
Microsoft.Web.WebPages.OAuth.resources.dll[12KB]
Microsoft.Web.WebPages.OAuth.dll[28KB]
Microsoft.AspNet.WebPages.OAuth.2.0.20710.0.nupkg[18KB]
Microsoft.AspNet.WebPages.OAuth.zh-Hans.2.0.20710.0
Microsoft.Web.WebPages.OAuth.resources.dll[12KB]
Microsoft.AspNet.WebPages.OAuth.zh-Hans.2.0.20710.0.nupkg[11KB]
Microsoft.AspNet.WebPages.WebData.2.0.20710.0
WebMatrix.WebData.resources.dll[13KB]
WebMatrix.WebData.dll[73KB]
Microsoft.AspNet.WebPages.WebData.2.0.20710.0.nupkg[39KB]
Microsoft.AspNet.WebPages.WebData.zh-Hans.2.0.20710.0
WebMatrix.WebData.resources.dll[13KB]
Microsoft.AspNet.WebPages.WebData.zh-Hans.2.0.20710.0.nupkg[18KB]
Microsoft.AspNet.WebPages.zh-Hans.2.0.20710.0
System.Web.Helpers.resources.dll[15KB]
System.Web.WebPages.Deployment.resources.dll[12KB]
System.Web.WebPages.Razor.resources.dll[11KB]
System.Web.WebPages.resources.dll[19KB]
Microsoft.AspNet.WebPages.zh-Hans.2.0.20710.0.nupkg[68KB]
Microsoft.Net.Http.2.0.20710.0
System.Net.Http.WebRequest.resources.dll[10KB]
System.Net.Http.resources.dll[17KB]
System.Net.Http.WebRequest.dll[16KB]
System.Net.Http.dll[176KB]
Microsoft.Net.Http.2.0.20710.0.nupkg[104KB]
Microsoft.Net.Http.zh-Hans.2.0.20710.0
System.Net.Http.WebRequest.resources.dll[10KB]
System.Net.Http.resources.dll[17KB]
Microsoft.Net.Http.zh-Hans.2.0.20710.0.nupkg[32KB]
Microsoft.Web.Infrastructure.1.0.0.0
Microsoft.Web.Infrastructure.dll[44KB]
Microsoft.Web.Infrastructure.1.0.0.0.nupkg[24KB]
Microsoft.jQuery.Unobtrusive.Ajax.2.0.20710.0
Microsoft.jQuery.Unobtrusive.Ajax.2.0.20710.0.nupkg[5KB]
Microsoft.jQuery.Unobtrusive.Validation.2.0.20710.0
Microsoft.jQuery.Unobtrusive.Validation.2.0.20710.0.nupkg[8KB]
Modernizr.2.5.3
Modernizr.2.5.3.nupkg[17KB]
Newtonsoft.Json.4.5.6
Newtonsoft.Json.dll[381KB]
Newtonsoft.Json.dll[342KB]
Newtonsoft.Json.dll[366KB]
Newtonsoft.Json.dll[311KB]
Newtonsoft.Json.dll[314KB]
sl4-windowsphone71
Newtonsoft.Json.dll[311KB]
Newtonsoft.Json.dll[340KB]
Newtonsoft.Json.4.5.6.nupkg[1.14MB]
WebGrease.1.1.0
Antlr3.Runtime.dll[103KB]
WebGrease.dll[941KB]
WG.exe[1.01MB]
WebGrease.1.1.0.nupkg[701KB]
jQuery.1.7.1.1
common.ps1[3KB]
install.ps1[1KB]
uninstall.ps1[1KB]
jQuery.1.7.1.1.nupkg[174KB]
bined.1.8.20.1
ui-bg_flat_0_aaaaaa_40x100.png[180B]
ui-bg_flat_75_ffffff_40x100.png[178B]
ui-bg_glass_55_fbf9ee_1x400.png[120B]
ui-bg_glass_65_ffffff_1x400.png[105B]
ui-bg_glass_75_dadada_1x400.png[111B]
ui-bg_glass_75_e6e6e6_1x400.png[110B]
ui-bg_glass_95_fef1ec_1x400.png[119B]
ui-bg_highlight-soft_75_cccccc_1x100.png[101B]
ui-icons_x240.png[4KB]
ui-icons_2e83ff_256x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_cd0a0a_256x240.png[4KB]
ui-bg_flat_0_aaaaaa_40x100.png[180B]
ui-bg_flat_75_ffffff_40x100.png[178B]
ui-bg_glass_55_fbf9ee_1x400.png[120B]
ui-bg_glass_65_ffffff_1x400.png[105B]
ui-bg_glass_75_dadada_1x400.png[111B]
ui-bg_glass_75_e6e6e6_1x400.png[110B]
ui-bg_glass_95_fef1ec_1x400.png[119B]
ui-bg_highlight-soft_75_cccccc_1x100.png[101B]
ui-icons_x240.png[4KB]
ui-icons_2e83ff_256x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_x240.png[4KB]
ui-icons_cd0a0a_256x240.png[4KB]
bined.1.8.20.1.nupkg[223KB]
jQuery.Validation.1.9.0.1
jQuery.Validation.1.9.0.1.nupkg[31KB]
knockoutjs.2.1.0
knockoutjs.2.1.0.nupkg[62KB]
QRCode.sln[1KB]
QRCode.v11.suo[94KB]
QRCode.v12.suo[121KB]
from.gif[4KB]
最新Asp.Net源码下载.url[123B]
当前路径:QRCode/Scripts/jquery-1.7.1.js
* jQuery JavaScript Library v1.7.1
* Copyright 2011, John Resig
* Released under the the MIT License.
* http://jquery.org/license
* Includes Sizzle.js
* Copyright 2011, The Dojo Foundation
* Released under the MIT and BSD Licenses.
* Date: Mon Nov 21 21:11:03
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document,
navigator = window.navigator,
location = window.
var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
// A central reference to the root jQuery(document)
rootjQuery,
// A simple way to check for HTML strings or ID strings
// Prioritize #id over &tag& to avoid XSS via location.hash (#9521)
quickExpr = /^(?:[^#&]*(&[\w\W]+&)[^&]*$|#([\w\-]*)$)/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Used for trimming whitespace
trimLeft = /^\s+/,
trimRight = /\s+$/,
// Match a standalone tag
rsingleTag = /^&(\w+)\s*\/?&(?:&\/\1&)?$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
rvalidescape = /\\(?:[&\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
rvalidtokens = /&[^&\\\n\r]*&|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
// Useragent RegExp
rwebkit = /(webkit)[ \/]([\w.]+)/,
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
// Matches dashed string for camelizing
rdashAlpha = /-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + && ).toUpperCase();
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
// For matching the engine and version of the browser
browserMatch,
// The deferred used on DOM ready
readyList,
// The ready event handler
DOMContentLoaded,
// Save a reference to some core methods
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
push = Array.prototype.push,
slice = Array.prototype.slice,
trim = String.prototype.trim,
indexOf = Array.prototype.indexOf,
// [[Class]] -& type pairs
class2type = {};
jQuery.fn = jQuery.prototype = {
constructor: jQuery,
init: function( selector, context, rootjQuery ) {
var match, elem, ret,
// Handle $(&&), $(null), or $(undefined)
if ( !selector ) {
// Handle $(DOMElement)
if ( selector.nodeType ) {
this.context = this[0] =
this.length = 1;
// The body element only exists once, optimize finding it
if ( selector === &body& && !context && document.body ) {
this.context =
this[0] = document.
this.selector =
this.length = 1;
// Handle HTML strings
if ( typeof selector === &string& ) {
// Are we dealing with HTML string or an ID?
if ( selector.charAt(0) === &&& && selector.charAt( selector.length - 1 ) === &&& && selector.length &= 3 ) {
// Assume that strings that start and end with && are HTML and skip the regex check
match = [ null, selector, null ];
match = quickExpr.exec( selector );
// Verify a match, and that no context was specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -& $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] :
doc = ( context ? context.ownerDocument || context : document );
// If a single string is passed in and it's a single tag
// just do a createElement and skip the rest
ret = rsingleTag.exec( selector );
if ( ret ) {
if ( jQuery.isPlainObject( context ) ) {
selector = [ document.createElement( ret[1] ) ];
jQuery.fn.attr.call( selector, context, true );
selector = [ doc.createElement( ret[1] ) ];
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childN
return jQuery.merge( this, selector );
// HANDLE: $(&#id&)
elem = document.getElementById( match[2] );
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
if ( elem && elem.parentNode ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
return rootjQuery.find( selector );
// Otherwise, we inject the element directly into the jQuery object
this.length = 1;
this.context =
this.selector =
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return ( context || rootjQuery ).find( selector );
// HANDLE: $(expr, context)
// (which is just equivalent to: $(context).find(expr)
return this.constructor( context ).find( selector );
// HANDLE: $(function)
// Shortcut for document ready
} else if ( jQuery.isFunction( selector ) ) {
return rootjQuery.ready( selector );
if ( selector.selector !== undefined ) {
this.selector = selector.
this.context = selector.
return jQuery.makeArray( selector, this );
// Start with an empty selector
selector: &&,
// The current version of jQuery being used
jquery: &1.7.1&,
// The default length of a jQuery object is 0
length: 0,
// The number of elements contained in the matched element set
size: function() {
return this.
toArray: function() {
return slice.call( this, 0 );
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
return num == null ?
// Return a 'clean' array
this.toArray() :
// Return just the object
( num & 0 ? this[ this.length + num ] : this[ num ] );
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
var ret = this.constructor();
if ( jQuery.isArray( elems ) ) {
push.apply( ret, elems );
jQuery.merge( ret, elems );
// Add the old object onto the stack (as a reference)
ret.prevObject =
ret.context = this.
if ( name === &find& ) {
ret.selector = this.selector + ( this.selector ? & & : && ) +
} else if ( name ) {
ret.selector = this.selector + &.& + name + &(& + selector + &)&;
// Return the newly-formed element set
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// Add the callback
readyList.add( fn );
eq: function( i ) {
return i === -1 ?
this.slice( i ) :
this.slice( i, i + 1 );
first: function() {
return this.eq( 0 );
last: function() {
return this.eq( -1 );
slice: function() {
return this.pushStack( slice.apply( this, arguments ),
&slice&, slice.call(arguments).join(&,&) );
map: function( callback ) {
return this.pushStack( jQuery.map(this, function( elem, i ) {
return callback.call( elem, i, elem );
end: function() {
return this.prevObject || this.constructor(null);
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: [].sort,
splice: [].splice
// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
length = arguments.length,
// Handle a deep copy situation
if ( typeof target === &boolean& ) {
target = arguments[1] || {};
// skip the boolean and the target
// Handle case when target is a string or something (possible in deep copy)
if ( typeof target !== &object& && !jQuery.isFunction(target) ) {
target = {};
// extend jQuery itself if only one argument is passed
if ( length === i ) {
for ( ; i & i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
// Prevent never-ending loop
if ( target === copy ) {
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray =
clone = src && jQuery.isArray(src) ? src : [];
clone = src && jQuery.isPlainObject(src) ? src : {};
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] =
// Return the modified object
jQuery.extend({
noConflict: function( deep ) {
if ( window.$ === jQuery ) {
window.$ = _$;
if ( deep && window.jQuery === jQuery ) {
window.jQuery = _jQ
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
jQuery.readyWait++;
jQuery.ready( true );
// Handle when the DOM is ready
ready: function( wait ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
// Remember that the DOM is ready
jQuery.isReady =
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --jQuery.readyWait & 0 ) {
// If there are functions bound, to execute
readyList.fireWith( document, [ jQuery ] );
// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( &ready& ).off( &ready& );
bindReady: function() {
if ( readyList ) {
readyList = jQuery.Callbacks( &once memory& );
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === &complete& ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( &DOMContentLoaded&, DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( &load&, jQuery.ready, false );
// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent( &onreadystatechange&, DOMContentLoaded );
// A fallback to window.onload, that will always work
window.attachEvent( &onload&, jQuery.ready );
// If IE and not a frame
// continually check to see if the document is ready
var toplevel =
toplevel = window.frameElement ==
} catch(e) {}
if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === &function&;
isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === &array&;
// A crude way of determining if an object is a window
isWindow: function( obj ) {
return obj && typeof obj === &object& && &setInterval&
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || &object&;
isPlainObject: function( obj ) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if ( !obj || jQuery.type(obj) !== &object& || obj.nodeType || jQuery.isWindow( obj ) ) {
// Not own constructor property must be Object
if ( obj.constructor &&
!hasOwn.call(obj, &constructor&) &&
!hasOwn.call(obj.constructor.prototype, &isPrototypeOf&) ) {
} catch ( e ) {
// IE8,9 Will throw exceptions on certain host objects #9897
// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.
for ( key in obj ) {}
return key === undefined || hasOwn.call( obj, key );
isEmptyObject: function( obj ) {
for ( var name in obj ) {
error: function( msg ) {
throw new Error( msg );
parseJSON: function( data ) {
if ( typeof data !== &string& || !data ) {
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
// Attempt to parse using the native JSON parser first
if ( window.JSON && window.JSON.parse ) {
return window.JSON.parse( data );
// Make sure the incoming data is actual JSON
// Logic borrowed from http://json.org/json2.js
if ( rvalidchars.test( data.replace( rvalidescape, &@& )
.replace( rvalidtokens, &]& )
.replace( rvalidbraces, &&)) ) {
return ( new Function( &return & + data ) )();
jQuery.error( &Invalid JSON: & + data );
// Cross-browser xml parsing
parseXML: function( data ) {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
xml = tmp.parseFromString( data , &text/xml& );
} else { // IE
xml = new ActiveXObject( &Microsoft.XMLDOM& );
xml.async = &false&;
xml.loadXML( data );
} catch( e ) {
if ( !xml || !xml.documentElement || xml.getElementsByTagName( &parsererror& ).length ) {
jQuery.error( &Invalid XML: & + data );
noop: function() {},
// Evaluates a script in a global context
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive//eval-javascript-global-context
globalEval: function( data ) {
if ( data && rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ &eval& ].call( window, data );
} )( data );
// Convert dashed to camelC used by the css and data modules
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, &ms-& ).replace( rdashAlpha, fcamelCase );
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
// args is for internal usage only
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction( object );
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
for ( ; i & ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
// A special, fast, case for the most common use of each
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
for ( ; i & ) {
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
// Use native String.trim function wherever possible
trim: trim ?
function( text ) {
return text == null ?
trim.call( text );
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
text.toString().replace( trimLeft, && ).replace( trimRight, && );
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type( array );
if ( array.length == null || type === &string& || type === &function& || type === &regexp& || jQuery.isWindow( array ) ) {
push.call( ret, array );
jQuery.merge( ret, array );
inArray: function( elem, array, i ) {
if ( array ) {
if ( indexOf ) {
return indexOf.call( array, elem, i );
len = array.
i = i ? i & 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i & i++ ) {
// Skip accessing in sparse arrays
if ( i in array && array[ i ] === elem ) {
return -1;
merge: function( first, second ) {
var i = first.length,
if ( typeof second.length === &number& ) {
for ( var l = second. j & j++ ) {
first[ i++ ] = second[ j ];
while ( second[j] !== undefined ) {
first[ i++ ] = second[ j++ ];
first.length =
grep: function( elems, callback, inv ) {
var ret = [], retV
// Go through the array, only saving the items
// that pass the validator function
for ( var i = 0, length = elems. i & i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
// arg is for internal usage only
map: function( elems, callback, arg ) {
var value, key, ret = [],
length = elems.length,
// jquery objects are treated as arrays
isArray = elems instanceof jQuery || length !== undefined && typeof length === &number& && ( ( length & 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
// Go through the array, translating each of the items to their
if ( isArray ) {
for ( ; i & i++ ) {
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] =
// Go through every key on the object,
for ( key in elems ) {
value = callback( elems[ key ], key, arg );
if ( value != null ) {
ret[ ret.length ] =
// Flatten any nested arrays
return ret.concat.apply( [], ret );
// A global GUID counter for objects
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
if ( typeof context === &string& ) {
var tmp = fn[ context ];
// Quick check to determine if target is callable, in the spec
// this throws a TypeError, but we will just return undefined.
if ( !jQuery.isFunction( fn ) ) {
// Simulated bind
var args = slice.call( arguments, 2 ),
proxy = function() {
return fn.apply( context, args.concat( slice.call( arguments ) ) );
// Set the guid of unique handler to the same of original handler, so it can be removed
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
// Mutifunctional method to get and set values to a collection
// The value/s can optionally be executed if it's a function
access: function( elems, key, value, exec, fn, pass ) {
var length = elems.
// Setting many attributes
if ( typeof key === &object& ) {
for ( var k in key ) {
jQuery.access( elems, k, key[k], exec, fn, value );
// Setting one attribute
if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
exec = !pass && exec && jQuery.isFunction(value);
for ( var i = 0; i & i++ ) {
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
// Getting an attribute
return length ? fn( elems[0], key ) :
now: function() {
return ( new Date() ).getTime();
// Use of jQuery.browser is frowned upon.
// More details: /Utilities/jQuery.browser
uaMatch: function( ua ) {
ua = ua.toLowerCase();
var match = rwebkit.exec( ua ) ||
ropera.exec( ua ) ||
rmsie.exec( ua ) ||
ua.indexOf(&compatible&) & 0 && rmozilla.exec( ua ) ||
return { browser: match[1] || &&, version: match[2] || &0& };
sub: function() {
function jQuerySub( selector, context ) {
return new jQuerySub.fn.init( selector, context );
jQuery.extend( true, jQuerySub, this );
jQuerySub.superclass =
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQueryS
jQuerySub.sub = this.
jQuerySub.fn.init = function init( selector, context ) {
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
context = jQuerySub( context );
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
jQuerySub.fn.init.prototype = jQuerySub.
var rootjQuerySub = jQuerySub(document);
return jQueryS
browser: {}
// Populate the class2type map
jQuery.each(&Boolean Number String Function Array Date RegExp Object&.split(& &), function(i, name) {
class2type[ &[object & + name + &]& ] = name.toLowerCase();
browserMatch = jQuery.uaMatch( userAgent );
if ( browserMatch.browser ) {
jQuery.browser[ browserMatch.browser ] =
jQuery.browser.version = browserMatch.
// Deprecated, use jQuery.browser.webkit instead
if ( jQuery.browser.webkit ) {
jQuery.browser.safari =
// IE doesn't match non-breaking spaces with \s
if ( rnotwhite.test( &\xA0& ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
// All jQuery objects should point back to these
rootjQuery = jQuery(document);
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( &DOMContentLoaded&, DOMContentLoaded, false );
jQuery.ready();
} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === &complete& ) {
document.detachEvent( &onreadystatechange&, DOMContentLoaded );
jQuery.ready();
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( jQuery.isReady ) {
// If IE is used, use the trick by Diego Perini
// /IEContentLoaded/
document.documentElement.doScroll(&left&);
} catch(e) {
setTimeout( doScrollCheck, 1 );
// and execute any waiting functions
jQuery.ready();
// String to Object flags format cache
var flagsCache = {};
// Convert String-formatted flags into Object-formatted ones and store in cache
function createFlags( flags ) {
var object = flagsCache[ flags ] = {},
flags = flags.split( /\s+/ );
for ( i = 0, length = flags. i & i++ ) {
object[ flags[i] ] =
* Create a callback list using the following parameters:
* flags: an optional list of space-separated flags that will change how
the callback list behaves
* By default a callback list will act like an event callback list and can be
* &fired& multiple times.
* Possible flags:
will ensure the callback list can only be fired once (like a Deferred)
will keep track of previous values and will call any callback added
after the list has been fired right away with the latest &memorized&
values (like a Deferred)
will ensure a callback can only be added once (no duplicate in the list)
* stopOnFalse: interrupt callings when a callback returns false
jQuery.Callbacks = function( flags ) {
// Convert flags from String-formatted to Object-formatted
// (we check in cache first)
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
var // Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = [],
// Last fire value (for non-forgettable lists)
// Flag to know if list is currently firing
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Add one or several callbacks to the list
add = function( args ) {
for ( i = 0, length = args. i & i++ ) {
elem = args[ i ];
type = jQuery.type( elem );
if ( type === &array& ) {
// Inspect recursively
add( elem );
} else if ( type === &function& ) {
// Add if not in unique mode and callback is not in
if ( !flags.unique || !self.has( elem ) ) {
list.push( elem );
// Fire callbacks
fire = function( context, args ) {
args = args || [];
memory = !flags.memory || [ context, args ];
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.
for ( ; list && firingIndex & firingL firingIndex++ ) {
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
memory = // Mark as halted
if ( list ) {
if ( !flags.once ) {
if ( stack && stack.length ) {
memory = stack.shift();
self.fireWith( memory[ 0 ], memory[ 1 ] );
} else if ( memory === true ) {
self.disable();
list = [];
// Actual Callbacks object
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
var length = list.
add( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.
// With memory, if we're not firing then
// we should call right away, unless previous
// firing was halted (stopOnFalse)
} else if ( memory && memory !== true ) {
firingStart =
fire( memory[ 0 ], memory[ 1 ] );
// Remove a callback from the list
remove: function() {
if ( list ) {
var args = arguments,
argIndex = 0,
argLength = args.
for ( ; argIndex & argL argIndex++ ) {
for ( var i = 0; i & list. i++ ) {
if ( args[ argIndex ] === list[ i ] ) {
// Handle firingIndex and firingLength
if ( firing ) {
if ( i &= firingLength ) {
firingLength--;
if ( i &= firingIndex ) {
firingIndex--;
// Remove the element
list.splice( i--, 1 );
// If we have some unicity property then
// we only need to do this once
if ( flags.unique ) {
// Control if a given callback is in the list
has: function( fn ) {
if ( list ) {
var i = 0,
length = list.
for ( ; i & i++ ) {
if ( fn === list[ i ] ) {
// Remove all callbacks from the list
empty: function() {
list = [];
// Have the list do nothing anymore
disable: function() {
list = stack = memory =
// Is it disabled?
disabled: function() {
// Lock the list in its current state
lock: function() {
if ( !memory || memory === true ) {
self.disable();
// Is it locked?
locked: function() {
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
if ( stack ) {
if ( firing ) {
if ( !flags.once ) {
stack.push( [ context, args ] );
} else if ( !( flags.once && memory ) ) {
fire( context, args );
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
// To know if the callbacks have already been called at least once
fired: function() {
var // Static reference to slice
sliceDeferred = [].
jQuery.extend({
Deferred: function( func ) {
var doneList = jQuery.Callbacks( &once memory& ),
failList = jQuery.Callbacks( &once memory& ),
progressList = jQuery.Callbacks( &memory& ),
state = &pending&,
resolve: doneList,
reject: failList,
notify: progressList
promise = {
done: doneList.add,
fail: failList.add,
progress: progressList.add,
state: function() {
// Deprecated
isResolved: doneList.fired,
isRejected: failList.fired,
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
always: function() {
deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
pipe: function( fnDone, fnFail, fnProgress ) {
return jQuery.Deferred(function( newDefer ) {
jQuery.each( {
done: [ fnDone, &resolve& ],
fail: [ fnFail, &reject& ],
progress: [ fnProgress, &notify& ]
}, function( handler, data ) {
var fn = data[ 0 ],
action = data[ 1 ],
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
newDefer[ action + &With& ]( this === deferred ? newDefer : this, [ returned ] );
deferred[ handler ]( newDefer[ action ] );
}).promise();
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
if ( obj == null ) {
for ( var key in promise ) {
obj[ key ] = promise[ key ];
deferred = promise.promise({}),
for ( key in lists ) {
deferred[ key ] = lists[ key ].
deferred[ key + &With& ] = lists[ key ].fireW
// Handle state
deferred.done( function() {
state = &resolved&;
}, failList.disable, progressList.lock ).fail( function() {
state = &rejected&;
}, doneList.disable, progressList.lock );
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
// All done!
// Deferred helper
when: function( firstParam ) {
var args = sliceDeferred.call( arguments, 0 ),
length = args.length,
pValues = new Array( length ),
count = length,
pCount = length,
deferred = length &= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
firstParam :
jQuery.Deferred(),
promise = deferred.promise();
function resolveFunc( i ) {
return function( value ) {
args[ i ] = arguments.length & 1 ? sliceDeferred.call( arguments, 0 ) :
if ( !( --count ) ) {
deferred.resolveWith( deferred, args );
function progressFunc( i ) {
return function( value ) {
pValues[ i ] = arguments.length & 1 ? sliceDeferred.call( arguments, 0 ) :
deferred.notifyWith( promise, pValues );
if ( length & 1 ) {
for ( ; i & i++ ) {
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
if ( !count ) {
deferred.resolveWith( deferred, args );
} else if ( deferred !== firstParam ) {
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
jQuery.support = (function() {
var support,
marginDiv,
eventName,
isSupported,
div = document.createElement( &div& ),
documentElement = document.documentE
// Preliminary tests
div.setAttribute(&className&, &t&);
div.innerHTML = &
&link/&&table&&/table&&a href='/a' style='top:1float:opacity:.55;'&a&/a&&input type='checkbox'/&&;
all = div.getElementsByTagName( &*& );
a = div.getElementsByTagName( &a& )[ 0 ];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return {};
// First batch of supports tests
select = document.createElement( &select& );
opt = select.appendChild( document.createElement(&option&) );
input = div.getElementsByTagName( &input& )[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName(&tbody&).length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName(&link&).length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute(&style&) ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: ( a.getAttribute(&href&) === &/a& ),
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to &on&.
// (WebKit defaults to && instead)
checkOn: ( input.value === &on& ),
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== &t&,
// Tests for enctype support on a form(#6743)
enctype: !!document.createElement(&form&).enctype,
// Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works
html5Clone: document.createElement(&nav&).cloneNode( true ).outerHTML !== &&:nav&&/:nav&&,
// Will be defined later
submitBubbles: true,
changeBubbles: true,
focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true
// Make sure checked status is properly cloned
input.checked =
support.noCloneChecked = input.cloneNode( true ).
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled =
support.optDisabled = !opt.
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
delete div.
} catch( e ) {
support.deleteExpando =
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( &onclick&, function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent =
div.cloneNode( true ).fireEvent( &onclick& );
// Check if a radio maintains its value
// after being appended to the DOM
input = document.createElement(&input&);
input.value = &t&;
input.setAttribute(&type&, &radio&);
support.radioValue = input.value === &t&;
input.setAttribute(&checked&, &checked&);
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.
fragment.removeChild( input );
fragment.appendChild( div );
div.innerHTML = &&;
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( window.getComputedStyle ) {
marginDiv = document.createElement( &div& );
marginDiv.style.width = &0&;
marginDiv.style.marginRight = &0&;
div.style.width = &2px&;
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
// Technique from Juriy Zaytsev
// /detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for( i in {
submit: 1,
change: 1,
focusin: 1
eventName = &on& +
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, && );
isSupported = ( typeof div[ eventName ] === &function& );
support[ i + &Bubbles& ] = isS
fragment.removeChild( div );
// Null elements to avoid leaks in IE
fragment = select = opt = marginDiv = div = input =
// Run tests that need a body at doc ready
jQuery(function() {
var container, outer, inner, table, td, offsetSupport,
conMarginTop, ptlm, vb, style, html,
body = document.getElementsByTagName(&body&)[0];
if ( !body ) {
// Return for frameset docs that don't have a body
conMarginTop = 1;
ptlm = &position:top:0;left:0;width:1height:1margin:0;&;
vb = &visibility:border:0;&;
style = &style='& + ptlm + &border:5px solid #000;padding:0;'&;
html = &&div & + style + &&&div&&/div&&/div&& +
&&table & + style + & cellpadding='0' cellspacing='0'&& +
&&tr&&td&&/td&&/tr&&/table&&;
container = document.createElement(&div&);
container.style.cssText = vb + &width:0;height:0;position:top:0;margin-top:& + conMarginTop + &px&;
body.insertBefore( container, body.firstChild );
// Construct the test element
div = document.createElement(&div&);
container.appendChild( div );
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
div.innerHTML = &&table&&tr&&td style='padding:0;border:0;display:none'&&/td&&td&t&/td&&/tr&&/table&&;
tds = div.getElementsByTagName( &td& );
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = &&;
tds[ 1 ].style.display = &none&;
// Check if empty table cells still have offsetWidth/Height
// (IE &= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
// Figure out if the W3C box model works as expected
div.innerHTML = &&;
div.style.width = div.style.paddingLeft = &1px&;
jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
if ( typeof div.style.zoom !== &undefined& ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE & 8 does this)
div.style.display = &inline&;
div.style.zoom = 1;
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = &&;
div.innerHTML = &&div style='width:4'&&/div&&;
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
div.style.cssText = ptlm +
div.innerHTML =
outer = div.firstC
inner = outer.firstC
td = outer.nextSibling.firstChild.firstC
offsetSupport = {
doesNotAddBorder: ( inner.offsetTop !== 5 ),
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
inner.style.position = &fixed&;
inner.style.top = &20px&;
// safari subtracts parent border width here which is 5px
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
inner.style.position = inner.style.top = &&;
outer.style.overflow = &hidden&;
outer.style.position = &relative&;
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
body.removeChild( container );
= container =
jQuery.extend( support, offsetSupport );
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([A-Z])/g;
jQuery.extend({
cache: {},
// Please use with caution
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: &jQuery& + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, && ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
&embed&: true,
// Ban all objects except for Flash (which handle expandos)
&object&: &clsid:D27CDB6E-AE6D-11cf-96B8-&,
&applet&: true
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
var privateCache, thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === &string&,
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQ JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
isEvents = name === &events&;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = ++jQuery.
id = internalK
if ( !cache[ id ] ) {
cache[ id ] = {};
// Avoids exposing jQuery metadata on plain JS objects when the object
// is serialized using JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.
// An object can be passed to jQuery.data instead of a key/ this gets
// shallow copied over onto the existing cache
if ( typeof name === &object& || typeof name === &function& ) {
if ( pvt ) {
cache[ id ] = jQuery.extend( cache[ id ], name );
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
privateCache = thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
if ( !pvt ) {
if ( !thisCache.data ) {
thisCache.data = {};
thisCache = thisCache.
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] =
// Users should not attempt to inspect the internal events object using jQuery.data,
// it is undocumented and subject to change. But does anyone listen? No.
if ( isEvents && !thisCache[ name ] ) {
return privateCache.
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
// First Try to find as-is property data
ret = thisCache[ name ];
// Test for null|undefined property data
if ( ret == null ) {
// Try to find the camelCased property
ret = thisCache[ jQuery.camelCase( name ) ];
ret = thisC
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
var thisCache, i, l,
// Reference to internal data cache key
internalKey = jQuery.expando,
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
// See jQuery.data for more information
id = isNode ? elem[ internalKey ] : internalK
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
if ( name ) {
thisCache = pvt ? cache[ id ] : cache[ id ].
if ( thisCache ) {
// Support array or space separated string names for data keys
if ( !jQuery.isArray( name ) ) {
// try the string as a key before any manipulation
if ( name in thisCache ) {
name = [ name ];
// split the camel cased version by spaces unless a key with the spaces exists
name = jQuery.camelCase( name );
if ( name in thisCache ) {
name = [ name ];
name = name.split( & & );
for ( i = 0, l = name. i & i++ ) {
delete thisCache[ name[i] ];
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
// See jQuery.data for more information
if ( !pvt ) {
delete cache[ id ].
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject(cache[ id ]) ) {
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS other browsers
// don't care
// Ensure that `cache` is not a window object #10080
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
delete cache[ id ];
cache[ id ] =
// We destroyed the cache and need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
if ( isNode ) {
// IE does not allow us to delete expando proper...

我要回帖

更多关于 qrcode生成二维码图片 的文章

 

随机推荐