学习笔记一:学用mootools的Ajax对象

看mootools能够按所需组件进行下载,所以对他尝试一下,第一个例子就是Ajax组件。

这个是客户端文件:testAjax.html

<head>
<title>测试Ajax</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<script type="text/javascript" src="./js/mootools.v1.00.js?v=1"></script>
</head>
<body>

<textarea id=content cols=80 rows=20>
</textarea>

<script language="javascript" type="text/javascript">
    
new Ajax("./testAjax.php", {
        method: 'get',
        onComplete: 
function(){
            $('content').value 
= this.response.text;
        }
        }).request();
</script>

</body>
</html>


 

这个是服务器文件:testAjax.php
<?php
header('Content-Type:text/html;charset=gb2312');//防止中文信息有乱码
header('Cache-Control:no-cache');//防止浏览器缓存,导致按F5刷新不管用
echo('This is a test for mootools.Ajax,中文信息没有乱码');
?>


简单吗?。。。

posted on 2007-04-05 11:45 PeakGao 阅读(4498) 评论(3)  编辑 收藏 引用 所属分类: Javascriptphp

评论

# re: 学习笔记一:学用mootools的Ajax对象 2007-04-12 16:23 Starling

弱弱的问一下,在 asp.net 下怎么做??  回复  更多评论   

# re: 学习笔记一:学用mootools的Ajax对象 2007-04-13 09:30 PeakGao

@Starling

asp.net不是很清楚,可能是类似下面的语法:

// testAjax.aspx
<%
Response.Charset("GB2312");
Response.Write('This is a test for mootools.Ajax,中文信息没有乱码');

%>

具体语法不记得了,以前稍稍学过asp.net,但是没有用来应用,网上有很多这方面的帖子。
  回复  更多评论   

# re: 学习笔记一:学用mootools的Ajax对象 2011-05-18 09:08 jaclon

mootools就帮助文档吗,像jquery.chm这样的  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(9)

随笔分类(67)

随笔档案(65)

搜索

最新评论

阅读排行榜

评论排行榜