správná URL i v javascriptu
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 26 Jan 2011 03:35:01 +0100
changeset 181bcf03fc1e3f9
parent 180 7eb749d4a949
child 182 bb8af29610c4
správná URL i v javascriptu
(aby fungoval i na /podnik/123 a ne jen v /aaa=bbb)
java/nekurak.net-web/web/WEB-INF/tags/nekurak/stranka.tag
java/nekurak.net-web/web/js/hlasovani.js
java/nekurak.net-web/web/js/komentare.js
     1.1 --- a/java/nekurak.net-web/web/WEB-INF/tags/nekurak/stranka.tag	Wed Jan 26 03:24:40 2011 +0100
     1.2 +++ b/java/nekurak.net-web/web/WEB-INF/tags/nekurak/stranka.tag	Wed Jan 26 03:35:01 2011 +0100
     1.3 @@ -48,6 +48,10 @@
     1.4  		</head>
     1.5  		<body>
     1.6  			<p id="csrfToken"><c:out value="${sessionScope['CSRF_TOKEN']}"/></p>
     1.7 +			<script type="text/javascript">
     1.8 +				var nekurak = {};
     1.9 +				nekurak.contextPath = "${zc}";
    1.10 +			</script>
    1.11  			<div class="body">
    1.12  
    1.13  				<div id="horniPruh">
     2.1 --- a/java/nekurak.net-web/web/js/hlasovani.js	Wed Jan 26 03:24:40 2011 +0100
     2.2 +++ b/java/nekurak.net-web/web/js/hlasovani.js	Wed Jan 26 03:35:01 2011 +0100
     2.3 @@ -9,7 +9,7 @@
     2.4  		/**
     2.5  		 * TODO: správné URL – ${zc}
     2.6  		 */
     2.7 -		url: "zdroje/hlas/",
     2.8 +		url: nekurak.contextPath + "zdroje/hlas/",
     2.9  		data: pozadavek,
    2.10  		contentType: "text/xml",
    2.11  		dataType: "text",
     3.1 --- a/java/nekurak.net-web/web/js/komentare.js	Wed Jan 26 03:24:40 2011 +0100
     3.2 +++ b/java/nekurak.net-web/web/js/komentare.js	Wed Jan 26 03:35:01 2011 +0100
     3.3 @@ -8,12 +8,12 @@
     3.4  	/**
     3.5  	 * TODO: správné URL – ${zc}
     3.6  	 */
     3.7 -	$("#formularKomentuj .vystup").load("komentare", $("#formularKomentuj form").serialize());
     3.8 +	$("#formularKomentuj .vystup").load(nekurak.contextPath + "komentare", $("#formularKomentuj form").serialize());
     3.9  };
    3.10  
    3.11  komentare.odeslat = function() {
    3.12  	/**
    3.13  	 * TODO: správné URL – ${zc}
    3.14  	 */
    3.15 -	$("#formularKomentuj .vystup").load("komentare?odeslat=true", $("#formularKomentuj form").serialize());
    3.16 +	$("#formularKomentuj .vystup").load(nekurak.contextPath + "komentare?odeslat=true", $("#formularKomentuj form").serialize());
    3.17  };