Started

Selectors

Utilities

Animation

AJAX

CSS

Event

Manipulation

Cookie

String

Attributes

Data

Storage

Miscellaneous

$json.isJSON

Check a string whether JSON
$json.isJSON( string )
  1. element [string]
    The string will be checked.

Notes

This function is used for check a string is JSON on $ajax().

Example

HTML code
<div id="box">{"John":{"age":20,"phone":"39-2039-492","email":"john@email.com"},"Tom":{"age":20,"phone":"39-2039-492","email":"john@email.com"}}</div>
<button onclick="start_check()">start check</button>
JavaScript code
function start_check()
{
	alert($json.isJSON($text($("box"))));
}
Demonstration
{"John":{"age":20,"phone":"39-2039-492","email":"john@email.com"},"Tom":{"age":20,"phone":"39-2039-492","email":"john@email.com"}}