Home / Công nghệ Web / JavaScript

JavaScript

Fastest way to get the first n elements of a List into an Array

Fastest way to get the first n elements of a List or an Array

def s = ‘Hello Groovy world!’ assert s.take(5) == ‘Hello’ assert s.drop(6) == ‘Groovy world!’ Python Let’s assume an arbitrary list/array: in_list = list(range(10)) // Python2: in_list = range(10) // in_array = [i for i in range(10)] Slicing the list ...

Read More »

How to change font size for text shown on arcs in D3Js

A bubble chart built in D3js with the forced layout algorithm

using .style(“font-size”, “1.5em”)

Read More »

Checking existence of an element in an array with JavaScript

Checking existence of an element in an array with JavaScript

JavaScript is a loosely typed or a dynamic language. Variables in JavaScript are not directly associated with any particular value type, and any variable can be assigned (and reassigned) values of all types. In other words, everything in JavaScript is ...

Read More »

(English) Understanding data type of dictionary in JavaScript

Understanding Dictionary in JavaScript

Rất tiếc, mục này chỉ tồn tại ở Tiếng Anh.

Read More »

How to build and render data in JSON format with Grails

The graphical representation of the illustrated application

Nowadays, an awful lot of web based applications are using JSON as a principal data to load and render information rapidly. While some applications store data into persistence volume as JSON string, the others still use relational databases as the ...

Read More »

Event Delegation trong jQuery

What is Event Delegation?

Event delegation là cách để giải quyết vấn vấn đề: trong những đoạn html được cập nhật bằng ajax (ajax updated content). Tham khảo https://learn.jquery.com/events/event-delegation/ https://blog.revathskumar.com/2013/10/jquery-on-avoid-losing-event-binding-for-ajaxed-contents.html Click doesn’t work after AJAX load – jQuery

Read More »

(English) Understanding Array in JavaScript

Rất tiếc, mục này chỉ tồn tại ở Tiếng Anh.

Read More »

How to use console dot table in Console

This post shows how to use console.table to display a JSON data as the table in DevTool panel in Console tab

Read More »

Cách thức truy cập các giá trị đã chọn trong một nhóm checkbox

Rất tiếc, mục này chỉ tồn tại ở Tiếng Pháp và Tiếng Anh.

Read More »

Create an image gallery with jQuery

http://workshop.rs/2009/12/image-gallery-with-fancy-transitions-effects/

Read More »