This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('content-type: application/json; charset=utf-8'); | |
/* * / | |
$phi = array('okey' => 0, 'object' => array ("firstName"=> 'Philippe', 'lastName'=> 'Charriere')); | |
$j = array('okey' => 1, 'object' => array ('firstName'=> 'John', 'lastName'=> 'Resig')); | |
$v = array('okey' => 2, 'object' => array ('firstName'=> 'Linus', 'lastName'=> 'Torvald')); | |
$m = array('okey' => 3, 'object' => array ('firstName'=> 'Douglas', 'lastName'=> 'Crockford')); | |
/* */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function list_return(return_values){ | |
this.Objects = return_values; | |
function add_li(list, text) { | |
var list = document.getElementById(list); | |
var li = document.createElement("li"); | |
li.innerHTML = text; | |
list.appendChild(li); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |