易截截图软件、单文件、免安装、纯绿色、仅160KB

jquery ajax 提交中文乱码解决方法

$.ajax({
     url: "auto_action.jsp",
     type: "POST",
     data: {nickName:request.term},
     contentType :"application/x-www-form-urlencoded;charset=UTF-8", //加上这句就可以了!
     success: function(data) {
      alert(data);
     }
    });


相关文档:

创建ajax中的xmlhttprequest对象

<html>
<body>
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
    {
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
catch (e)
    {
  // Inte ......

AJAX中DragPanelExtender扩展控件


页面代码:
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManage ......

Ajax 的状态介绍

在《Pragmatic Ajax A Web 2.0 Primer 》中偶然看到对readyStae状态的介绍,感觉这个介绍很实在,摘译如下:
0: (Uninitialized) the send( ) method has not yet been invoked.
1: (Loading) the send( ) method has been invoked, request in progress.
2: (Loaded) the send( ) method has completed, entire respons ......

简单的AJAX获取数据库表数据

A.aspx页面放一个dropdownlist,在A.aspx.cs添加: this.drpSchool.Attributes.Add("onchange", "load(this.options[this.selectedIndex].value)");
在A.aspx页面添加如下脚本:
function load(state){
var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
......

Ajax跨域问题解决方案

由于安全问题的考虑,Ajax(xmlhttprequest)默认是不支持跨域调用的。比如在www.cadal.com去请求www.test.cadal.com的数据,都是不行的。
解决方案有很多,总结如下:
参考:
1.利用<script>标签
Difficult to know when the content is available, no standard methodology, can be considered a "security risk" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号