diff --git a/ajax+json/ajax.php b/ajax+json/ajax.php index 902b3fc..fc18151 100644 --- a/ajax+json/ajax.php +++ b/ajax+json/ajax.php @@ -1,6 +1,6 @@ german = $german; + $this->english = $english; + $this->french["val1"] = $french; + $this->french["val2"] = "jokus"; + } + } + $encoding = FALSE; if (isset ($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos ($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== FALSE) @@ -30,10 +46,8 @@ $result = FALSE; if ($encoding !== FALSE) - $result = gzcompress (json_encode (array( - "english" => 'doing gzip', - "german" => 'gezipedte Daten', - "french" => 'la zippo'))); + $result = gzcompress (json_encode (new dummy ( + 'doing gzip', 'gezipedte Daten', 'la zippo'))); if ($result !== FALSE) { @@ -44,10 +58,8 @@ } else { - $result = json_encode (array( - "english" => 'doing no gzip', - "german" => 'nicht gezipedte Daten', - "french" => 'no la zippo')); + $result = json_encode (new dummy ( + 'doing no gzip', 'nicht gezipedte Daten', 'no la zippo')); print ($result); } diff --git a/ajax+json/test1.html b/ajax+json/test1.html index a1fde3e..3bf7f8f 100644 --- a/ajax+json/test1.html +++ b/ajax+json/test1.html @@ -25,7 +25,7 @@ // schreiben des ergebnisses german_field.value = translation.german; - french_field.value = translation.french; + french_field.value = translation.french.val1; } break;