We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var innerA = document.getElementsByTagName('iframe')[0].contentWindow.a; var inndrB = document.getElementsByTagName('iframe')[0].contentWindow.b;
修改成
var ifrContent = document.getElementsByTagName('iframe')[0].contentWindow var innerA = ifrContent.a; var inndrB = ifrContent.b;
$(this).trigger('click'); $(this).find('.b'); $('.a').trigger('click'); $('.a').find('.b');
var $this = $(this); var $a = $('.a'); $this.trigger('click'); $this.find('.b'); $a.trigger('click'); $a.find('.b');
function A(){ var a='',b='',c=''; ---函数体--- }
$.fn.extend({ alertValue:function(){ alert(this.val()); } }); $("input.a").alertValue();//这样调用 this指向$("input.a")
$.extend({ alert1:function(){ alert(1); } }); $.alert1();//这样调用
$(function() { function Person() { } Person.prototype = { constructor: Person, bindEvent: function() { var self = this; $('body').on('click', '.person-btn', function(event) { var $this = $(this), method = ''; if ($this.hasClass('disabled')) { return; } method = $this.attr('method'); typeof self[method] == 'function' && self[method]($this, event); }); }, sayHello: function($obj, event) { }, sayGoodbye: function($obj, event) { } }; (new Person()).bindEvent(); }) html: <button class="person-btn" method="sayHello">你好</button> <button class="person-btn" method="sayGoodbye">再见</button>
function log(){ if('dev' == window.environment){ console.log.apply(console,arguments); } } log(1,2);//1,2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
JavaScript篇
修改成
jQuery对象命名建议以$开头方便区分。
修改成
The text was updated successfully, but these errors were encountered: