Posts Tagged ‘javascript’


Thousand Separator in JavaScript

   Posted by: Grumelo    in javascript

How to render such a number -9,521,654.35 in JavaScript ?

Read the rest of this entry »

Tags: , , , , ,


Characters to escape in JSON

   Posted by: Grumelo    in javascript, web

Several characters must be escaped in JSON data to avoid any problems while reading them in JavaScript.

These characters are :

  • ‘ single quote
  • ” quote
  • \ backslash
  • all control characters like \n \t

Read the rest of this entry »

Tags: , , , ,


Sorting multi-dimensional JavaScript arrays

   Posted by: Grumelo    in javascript, web

Sorting an array in JavaScript is done with <array>.sort()

sort() explanation in French
sort() explanation in English

It’s very easy and well explained in all JavasScript references.
When dealing with two-dimensional arrays or even worst with multi-dimensional arrays it’s another story.
Let me try to explain you thanks to clear examples.

Read the rest of this entry »

Tags: , , ,