java/nekurak.net-web/web/js/hlasovani.js
author František Kučera <franta-hg@frantovo.cz>
Tue, 25 May 2010 13:54:21 +0200
changeset 123 9135d52e8b0a
parent 111 401cc563a0c1
child 145 0efefbf5f8b6
permissions -rw-r--r--
Test hashovací funkce + test češtiny v identifikátorech
Java Language Specification – 3.8 Identifiers:
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#40625
     1 var hlasovani = {};
     2 
     3 hlasovani.hlasuj = function (podnik, hlas) {
     4     var pozadavek = "<hlas><kourit>" + hlas + "</kourit><podnik>" + podnik + "</podnik></hlas>";
     5 
     6     $.ajax({
     7 	type: "POST",
     8 	url: "zdroje/hlas/",
     9 	data: pozadavek,
    10 	contentType: "text/xml",
    11 	dataType: "text",
    12 	success: function(odpoved) {
    13 	    if (odpoved == "ok") {
    14 		/** TODO: předělat informaci – nepoužívat alert ale text v SVG */
    15 		/** TODO: Lokalizace */
    16 		alert("Váš hlas byl přijat.");
    17 	    } else {
    18 		/** TODO: předělat ošetřování chyb */
    19 		alert("Při hlasování došlo k chybě.");
    20 	    }
    21 	}
    22     });
    23 };