<script language="javascript" src="prototype.js" ></script>
<body>点击后获取新浪内容<input name="click" type=button value="测 试" onclick="new Ajax.Request(\'http://www.sina.com.cn\',{method:\'get\',onSuccess: function(transport){ var response = transport.responseText;$(\'hello\').innerHTML=response;},onFailure:function(){alert(\'Something went wrong...\') } }); ">
<div id="hello"></div>
</body>
有一个中文乱码问题,据说是因为ajax按UTF-8来处理的,所以需要请求的页面指定为UTF-8才行,现在还没有找到客户端直接解决的办法
第二个ajax的小例子
<html><head><sc