මචන්
J Query code
$.get(listurl, function(result) {
//var temp = '[{"PARAMETER_UNIT":"%","SPECIFICATION":"2.5 - 3.5"}]';
$.each($.parseJSON(result), function(idx, obj) {
console.log(obj.PARAMETER_UNIT);
console.log(obj.SPECIFICATION);
});
});
php code
echo json_encode( $para1 );
[{"PARAMETER_UNIT":"%","SPECIFICATION":"2.5 - 3.5"}]
මෙක ජෙ කුවරි එකකට රිටන් කරනවා, එකෙන් අවුලක් එනවා
$.parseJSON(result) මෙතනින් අවුලක් එන්නේ
(SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data)
එත් ඔය temp කියන එක පාස් කලාම හරියට values එනවා
මොකක්ද අවුල පිලිතුරක් දෙන කෙනෙක්ට 6 බැගින් දෙනු ලැබේ ...
J Query code
$.get(listurl, function(result) {
//var temp = '[{"PARAMETER_UNIT":"%","SPECIFICATION":"2.5 - 3.5"}]';
$.each($.parseJSON(result), function(idx, obj) {
console.log(obj.PARAMETER_UNIT);
console.log(obj.SPECIFICATION);
});
});
php code
echo json_encode( $para1 );
[{"PARAMETER_UNIT":"%","SPECIFICATION":"2.5 - 3.5"}]
මෙක ජෙ කුවරි එකකට රිටන් කරනවා, එකෙන් අවුලක් එනවා
$.parseJSON(result) මෙතනින් අවුලක් එන්නේ
(SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data)
එත් ඔය temp කියන එක පාස් කලාම හරියට values එනවා
මොකක්ද අවුල පිලිතුරක් දෙන කෙනෙක්ට 6 බැගින් දෙනු ලැබේ ...
Last edited: