示例#1
0
foreach ($pManager->getPhotographerList() as $uid => $pArr) {
    $pList[] = (object) array('value' => (string) $uid, 'label' => $pArr['name']);
}
echo "var photographers = " . json_encode($pList) . ";";
echo "var collections = " . $imageExplorer->getCollections() . ";";
echo "var countries = [";
$countries = $imageExplorer->getCountries();
for ($i = 0; $i < count($countries); $i++) {
    echo '"' . $countries[$i] . '"';
    if ($i < count($countries) - 1) {
        echo ', ';
    }
}
echo '];';
echo "var states = [";
$states = $imageExplorer->getStates();
for ($i = 0; $i < count($states); $i++) {
    echo '"' . $states[$i] . '"';
    if ($i < count($states) - 1) {
        echo ', ';
    }
}
echo '];';
?>

        $(document).ready(function () {

            var taxaSuggest = function (searchTerm, callback) {
                if (searchTerm.length >= 3) {
                    $.get('rpc/gettaxasuggest.php?term=' + searchTerm, function (data, status) {
                        callback(eval(data));