background preloader

Js jquery

Facebook Twitter

Multiple Select. jQuery multiselect. Linq.js CRUD Methods. One of my favorite JavaScript libraries is Linq.js (LINQ for JavaScript).

Linq.js CRUD Methods

Unfortunately the author is not responding to pull requests so I’m going to post my update here. I’ve added CRUD methods to the library so that you can Add, Delete, and Update items easily. I’ve found this very useful pattern where I load a lot of data when the page loads, convert it to an Enumerable using Linq.js, then as the user modifies data update it locally and send updates back to the server asynchronously. Here are examples of each method I’ve added: You can download my linq.js file here. Alternatively you can pass a function to Update instead of an object (makes sense if you are updating more than one item at a time): Build an App with Vue.js: A Lightweight Alternative to AngularJS. Front-end frameworks like AngularJS allow us to build out very nice single page applications easily, especially when we become well versed with all the concepts.

Build an App with Vue.js: A Lightweight Alternative to AngularJS

However, for many projects, frameworks like Angular can actually be a little bit more than what we need. If all we want to do is implement a few features a single page application, it’s can be a bit much to setup the necessary config, routing, controllers, services and more that make up an Angular app. For something more lightweight, a great solution is Vue.js. Vue is a library that focuses heavily on the ViewModel—the two-way data bindings that tie what we see and interact with on the screen with the application’s data model. 將htmltabel轉成json. jQuery DataTables – How to add a checkbox column - JSFiddle. GitHub - wenzhixin/bootstrap-table: An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features. (supports twitter bootstrap v2 and v3) Griddle - React Grid Component.


KingKong Bruce記事: 如何為Visual Studio加上未支援的JavaScript框架InstelliSense功能,以React為例. 一開始提到VS2013是有原因的,在VS2013提供一個神奇JavaScript海螺,它提供一個很神奇的功能,如果你使用了一個Visual Studio還不正式支援的JavaScript框架(以下用React為例),那透過它的幫忙,你的Visual Studio就能取得有限React語法提示功能。

KingKong Bruce記事: 如何為Visual Studio加上未支援的JavaScript框架InstelliSense功能,以React為例

Trip.js. Examples - Select2. Single select boxes Select2 can take a regular select box like this... and turn it into this...

Examples - Select2

Alaska Multiple select boxes. A Star Rating Plugin - Washington Botelho. You need just to have a div to build the Raty.

A Star Rating Plugin - Washington Botelho

Used when we want starts with a saved rating. If you need to start you score depending of a dynamic value, you can to use callback for it. Mrkt 的程式學習筆記: JavaScript – String.format. jQuery Overview. What is jQuery?

jQuery Overview

jQuery is a fast and concise JavaScript Library created by John Resig in 2006 with a nice motto − Write less, do more. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is a JavaScript toolkit designed to simplify various tasks by writing less code. Here is the list of important core features supported by jQuery − How to use jQuery? There are two ways to use jQuery. Local Installation − You can download jQuery library on your local machine and include it in your HTML code.CDN Based Version − You can include jQuery library into your HTML code directly from Content Delivery Network (CDN). Local Installation. Memoization暫存方法. Functions can use objects to remember the results of previous operations, making it possible to avoid unnecessary work.


This optimization is called memoization. JavaScript's objects and arrays are very convenient for this. Let's say we want a recursive function to compute Fibonacci numbers. A Fibonacci number is the sum of the two previous Fibonacci numbers. The first two are 0 and 1: This works, but it is doing a lot of unnecessary work. ECMAJAVASCRIPT陣列方法. The JavaScript Array object is a global object that is used in the construction of arrays; which are high-level, list-like objects.


Create an Array var fruits = ["Apple", "Banana"]; console.log(fruits.length); Access (index into) an Array item var first = fruits[0]; var last = fruits[fruits.length - 1]; Loop over an Array fruits.forEach(function (item, index, array) { console.log(item, index);}); Add to the end of an Array var newLength = fruits.push("Orange"); Remove from the end of an Array.


介紹jQuery map()與grep() - 黑暗執行緒. 寫這篇的動機是常在專案看到「古典式」JavaScript陣列處理,例如:跑迴圈將物件陣列的某個字串屬取出轉成字串陣列、篩選物件陣列取得特定類別的集合。

介紹jQuery map()與grep() - 黑暗執行緒

用for迴圈處理沒什麼不對,但既然專案已經用了jQuery,能一行搞定卻寫成三五行不免可惜(程式又不按行數計酬,寫愈多手愈酸咩 XD)。 感覺上還有些朋友不認識$.map()跟$.grep()這兩個好東西,故寫篇文章推薦一下。 若用LINQ做比方,$.map()相當於 .Select(o => 傳回數值或其他型別物件).ToArray(),可將物件陣列轉換成某個屬性或其他型別物件組成的陣列;$.grep()則類似 .Where(o => 傳回布林值).ToArray(),可過濾陣列保留符合條件的元素項目。 使用概念如下,輸入陣列,執行後傳回陣列: $.map(array, function(element, index) { return 新陣列的元素; }); (註:若輸出陣列想略過特定元素,就return null或undefined) $.grep(array, function(element, index) { return true或false; }); (傳回true的元素才會出現在篩選結果) 來看實例,以下程式有四個範例,分別用傳統方法及$.map(), $.grep()實現「物件陣列轉字串陣列」以及「過濾物件陣列保留特定類別」,程式不複雜,直接看程式碼,開始想想可以用在哪些專案角萿吧!

排版顯示純文字複製文字 <title>jQuery map & grep</title> function Product(category, name) {