Ajax.Request问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 04:50:49
<!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=gb2312" />
<title>chapter3</title>
<script type="text/javascript" language="javascript" src="prototype.js"></script>
<script type="text/javascript" language="javascript">
function test(){
var myAjax=new Ajax.Request{
'data.html',
{
method:'get',
onComplete:showResponse
}
};
}
function showResponse(resp

编译错误吧?
看出了点点 粗心的地方
new Ajax.Request() // 你写的是 {}
希望有所帮住` 其他的没有错误被我发现

<!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=gb2312" />
<title>chapter3</title>
<script type="text/javascript" language="javascript" src="prototype.js"></script>
<script type="text/javascript" language="javascript">
function test(){
new Ajax.Request('data.html', { method:'get', onComplete:showResponse }