Thread Problem mit Umlauten (jQuery) (42 answers)
Opened by MartinR at 2011-12-27 13:42

GwenDragon
 2011-12-27 15:05
#155095 #155095
User since
2005-01-17
14711 articles
Admin1
[Homepage]
user image
Bei mir funktioniert folgendes korrekt:

Code (perl): (dl )
1
2
3
4
5
6
7
8
#!/usr/bin/perl

use CGI qw/:all/;

charset('utf-8');
print header;

print $_,': ',param($_),br for (param);


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/js/jquery.js"></script>
<script language="javascript" type="text/javascript">
function speichern() {
$.ajax(
{
type: "post",
url: "/cgi/x.pl",
data: $("#form").serialize(),
success: function(msg) {
alert(msg);
},
error: function() {
alert('fehler');
}
});
}
</script>

<body>
<form action="/cgi/x.pl" method="post" enctype="application/x-www-form-urlencoded" name="form" id="form">
<input type="text" name="wert" id="wert" />
<input type="submit" name="submit" id="submit" value="Senden" />
<input type="button" name="button" id="button" value="Ajax" onclick="speichern();" />
</form>
</body></html>


Sowohl Perl-CGI als auch Ajax zeigen da Chinesisch, Deutsch, Russiches u. ä. korrekt an.
Last edited: 2011-12-27 15:07:39 +0100 (CET)

View full thread Problem mit Umlauten (jQuery)