损坏的ajax结果

I am using the following html page:

<html>

<head>

<title>AJAX Example</title>

<meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1">

</head>

<script language="JavaScript" src="ajaxlib.js"></script>

<!--define the ajax javascript library-->

<body>

Click this <a href="#" OnClick="GetEmployee()">link</a> to show ajax

content (will be processed backgroundly without

refreshing whole page)<br/>

<!--a href=# OnClick=GetEmployee() is the javascript event on a

link to execute javascript function (GetEmployee) inside ajaxlib.js-->

<div id="Result">< the result will be fetched here ></div>

<!--javascript use GetElementById function to replace the data

backgroundly, we use <div> tag with  id Result here so javascript

can replace this value-->

</body>

</html>

The Javascript is here: http://www.nomorepasting.com/getpaste.php?pasteid=22046

And the PHP is here: http://www.nomorepasting.com/getpaste.php?pasteid=22047

The problem is, everything seems logical and there are no errors, but the javascript does not seem to be called, and calling the php file directly gives a result such as this:

Well the characters will not even paste in apparently...., but lots of little boxes with like this:

10
01

I suggest getting Firefox + tamper data add-on.. You'll be able to see if your browser is downloading the javascript, and also view the ajax request + data to see what's going on. Also checkout the error console for javascript errors. I would start there.

For starters, your getEmployee() function should return false; to prevent the default action on the <a>. The little boxes thing seems to imply that the character sets aren't matching up. Make sure that the HTML page and the PHP page both use the same character set. I'd suggest trying to make everything UTF-8.

Edit: misread slightly - I think it's the character set PHP is outputting doesn't match the character set in your database.