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);
}
});
相关文档:
<html>
<body>
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Inte ......
好久不碰WEB的东东了,最近学习SAP的BSP技术,又用到这些,顺便转篇文章,备查.
原文地址: http://www.ibm.com/developerworks/cn/xml/x-ajaxxml2/
Ajax 和 XML:
五
种常见 Ajax 模式
可立即使用这些非常有用的 Ajax 设计模式
文档选项
<tr valign="top"><td width="8">< ......
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1是updatepanel的id
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1是updatepanel的id
......
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");
......
摘自:http://www.ibm.com/developerworks/library/wa-aj-jsonp1/
AJAX Same-Origin Policy(SOP) limitation:
AJAX prevents cross-domail invokation, there are several ways to by pass this limitation.
1. write a proxy on the server side. The SOP limitation only exists only on the javascript si ......