骨灰級Eclipse安裝ADT圖文擷取記錄 :D
安裝ADT外掛,輸入網址
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/
/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
$('#ProspectDtlFrm').validate({
rules: {
prsptEmail: {
required: {
depends: function(element) {
return ($('#prsptHomePhone').val() == '' &&
$('#prsptBusinessPhone').val() == '' &&
$('#prsptMobilePhone').val() == '');
}
}
}
},
messages: {
prsptEmail: 'Please enter your first name'
}
});
var iframe = $("#videoIntro")[0];
if (typeof(iframe) != "undefined") {
var player = $f(iframe);
}
$('#frmAnalytics_ReportGroup').val('avg').selectmenu('refresh');
欲代理區域:
<input type="checkbox" id="north" name="area" value="north" /> 北部
<input type="checkbox" id="central" name="area" value="central" /> 中部
<input type="checkbox" id="south" name="area" value="south" /> 南部
<input type="checkbox" id="east" name="area" value="east" /> 東部
$validatedContact
= $("#contactForm").validate({
rules: {
//共同 checkbox
area: {
required: true
,minlength: 2
}
},
messages:{
area: {
required: "區域未選取"
,minlength: "至少選取二個區域"
}
},
submitHandler: function(form) {
}
});
$("#contactForm").data("validator", null);
$("#contactForm").unbind("validate");
$("#contactForm").removeData("validator")
$("#contactForm").unbind("submit");//必需移除submit的行為,不然會多重綁定
id="register_hyperlink" href="javascript:void();">Register an account
id="register_hyperlink" href="javascript:void(0);">Register an account
echo date('Y年n月d日',strtotime('2014-11-18'));
function dateAdd(date, interval, units) {
var ret = new Date(date); //don't change original date
switch(interval.toLowerCase()) {
case 'year' :
ret.setFullYear(ret.getFullYear() + units);
break;
case 'quarter':
ret.setMonth(ret.getMonth() + 3*units);
break;
case 'month' :
ret.setMonth(ret.getMonth() + units);
break;
case 'week' :
ret.setDate(ret.getDate() + 7*units);
break;
case 'day' :
ret.setDate(ret.getDate() + units);
break;
case 'hour' :
ret.setTime(ret.getTime() + units*3600000);
break;
case 'minute' :
ret.setTime(ret.getTime() + units*60000);
break;
case 'second' :
ret.setTime(ret.getTime() + units*1000);
break;
default :
ret = undefined;
break;
}
return ret;
}

<form id="investQuestionnaireForm">
<div id="investQuestionnaireList"
ng-controller="MyQuestionnaireCtrl" class="dialog-moduleContent msgBoxDetail">
<div class="question-list">
<ul >
<li ng-repeat="(qTitle, ansList) in questionnaireList"
ng-init="qTitleIndex = $index">
<div>{{qTitle}}</div>
<ul class="answerlist">
<li ng-repeat="ans in ansList">
<input type="radio" name="{{qTitleIndex}}_ans_{{$index}}" value="{{ans}}" /> {{ans}} <br/>
</li>
</ul>
</li>
</ul>
</div>
</div>
最後示意
;(function($) {
//define plugin name
var pluginName = 'jqueryPlugin';
//create plugin class
function Plugin (element,options){
this.el = element;
this.$el = $(element);
this.options = $.extend({}, $.fn[pluginName].defaults, options);
//constrctor
this.init();
return this;
};
Plugin.prototype.name = pluginName;
Plugin.prototype.version = '0.0.1';
Plugin.prototype = {
init : function(){
var plugin = this;
},
/**
* The 'destroy' method is were you free the resources used by your plugin:
* references, unregister listeners, etc.
*
* Remember to unbind for your event:
*
* @example
* this.$someSubElement.off('.' + pluginName);
*
* Above example will remove any listener from your plugin for on the given
* element.
*/
destroy: function() {
// Remove any attached data from your plugin
this.$el.removeData();
},
/**
* Write public methods within the plugin's prototype. They can
* be called with:
*
* @example
* $('#element').jqueryPlugin('somePublicMethod','Arguments', 'Here', 1001);
*
* @param {[type]} foo [some parameter]
* @param {[type]} bar [some other parameter]
* @return {[type]}
*/
pubMethod : function(){
}
}
/**
* This is a real private method. A plugin instance has access to it
* @return {[type]}
*/
var privateMethod = function() {
console.log("privateMethod");
console.log(this);
};
// Plugin wrapper around the constructor,
$.fn[pluginName] = function(options) {
var args = arguments;
if (options === undefined || typeof options === 'object') {
// Create a plugin instance for each selected element.
return this.each(function() {
if (!$.data(this, 'plugin_' + pluginName)) {
$.data(this, 'plugin_' + pluginName, new Plugin(this, options));
}
});
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
// Call a pluguin method for each selected element.
if (Array.prototype.slice.call(args, 1).length == 0 && $.inArray(options, $.fn[pluginName].getters) != -1) {
// If the user does not pass any arguments and the method allows to
// work as a getter then break the chainability
var instance = $.data(this[0], 'plugin_' + pluginName);
return instance[options].apply(instance, Array.prototype.slice.call(args, 1));
} else {
// Invoke the speficied method on each selected element
return this.each(function() {
var instance = $.data(this, 'plugin_' + pluginName);
if (instance instanceof Plugin && typeof instance[options] === 'function') {
instance[options].apply(instance, Array.prototype.slice.call(args, 1));
}
});
}
}
}
/**
* Names of the pluguin methods that can act as a getter method.
* @type {Array}
*/
$.fn[pluginName].getters = ['pubMethod'];
/**
* Default options
*/
$.fn[pluginName].defaults = {
defaultOption: "I'm a default option"
};
})(jQuery);
$(buttonSelector).attr('data-icon', newIcon)
.find('.ui-icon')
.addClass('ui-icon-' + newIcon)
.removeClass('ui-icon-' + oldIcon);
app.directive('errSrc', function() {
return {
link: function(scope, element, attrs) {
scope.$watch(function() {
return attrs['ngSrc'];
}, function (value) {
if (!value) {
element.attr('src', attrs.errSrc);
}
});
element.bind('error', function() {
element.attr('src', attrs.errSrc);
});
}
}
})

app.config()app.run()app.controller()Run blocks - get executed after the injector is created and are used to kickstart the application. Only instances and constants can be injected into run blocks. This is to prevent further system configuration during application run time.Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
<div ng-app="myApp" ng-controller="myCtrl">
<div test1 test2> </div>
</div>
var myApp = angular.module('myApp', []);
myApp.factory('aProvider', function() {
console.log("factory");
});
myApp.directive("test1", function() {
console.log("directive setup");
return {
compile: function() {console.log("directive compile");}
}
});
myApp.directive("test2", function() {
return {
link: function() {console.log("directive link");}
}
});
myApp.run(function() {
console.log("app run");
});
myApp.config( function() {
console.log("app config");
});
myApp.controller('myCtrl', function($scope) {
console.log("app controller");
});