mdp的AJAX和CONFIG


mdp的AJAX提交
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<msc type="form">
<head>
<title>人人</title>
<script>
<![CDATA[
function sendMes(){
var mes=document.getElementsByName("mes")[0].value;
var param1=document.getElementsByName("param1")[0].value;
alert(param1);
var request = new XMLHttpRequest();
request.onreadystatechange=function(){
if(request.readyState==0){

}else if(request.readyState==1){
request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
request.setRequestHeader('User-Agent', 'MSC3.0');
var str="_MSC_CMD_=QRY&action=bs-transfer@mdp&url=http://status.renren.com/doing/update.do?&method=POST&c="+mes+"&isAtHome=1&publisher_form_ticket="+param1+"&raw="+mes+"&requestToken="+param1;
request.send(str);
}else if(request.readyState==2){

}else if(request.readyState==3){

}else if (request.readyState == 4) {
if (request.status == 200 && request.responseXML != null){
var text = request.responseXML.documentElement.textContent;
alert("返回值"+text);
}
}
};
request.open("POST",application.url,true);
}
]]>
</script>
</head>
<body>
<span width="100%" bgcolor="6666FF">
<span>
<img src="image/logo-rr-159.png"/>
</span>
<span align="right">
<font size="xl">
<xsl:value-of select="//p[@class='name-and-icons']/a"></xsl:value-of>
</font>
</span>
</span>
<span width="100%">
<input type="text" name="mes" width="79%"/>
<input type="hidden" name="param1" value="{substring-before(//body,' ')}"/>
<input type="button" caption="发布" width="20%" href="script:sendMes()"/>
</span>
<span width="100%">
<font color="999999">好友新鲜事</font>
</span>
<span width="100%">

</span>
</body>
</msc>
</xsl:template>
</xsl:stylesheet>


mdp的mdp-config.xml

<?xml version="1.0" encoding="utf-8"?>
<mdp:configuration xmlns:mdp="http://mdp.d-heaven.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mdp.d-heaven.com d:\mdp-config.xsd">
<mdp:authorization>
<mdp:allow source="*" />
</mdp:authorization>
<!--数据源-->
<mdp:bs-config source="www.renren.com" encoding="utf-8">
<mdp:sso appid="MK9222">
<mdp:request sysid="MK9222" name="oa">
<mdp:url>http://www.renren.com/PLogin.do</mdp:url>
<mdp:method>POST</mdp:method>
<mdp:encoding>utf-8</mdp:encoding>
<mdp:params>email={username}&password={password}&origURL=http://www.renren.com/home&domain=renren.com</mdp:params>
</mdp:request>
</mdp:sso>
</mdp:bs-config>

<mdp:bs-config source="m.renren.com" encoding="utf-8">
<mdp:bs-page url="^http://m.renren.com/home.do\?from=\d*$" responseTemplate="response_m.xsl"></mdp:bs-page>
</mdp:bs-config>
<mdp:bs-config source="guide.renren.com" encoding="utf-8">
<mdp:bs-page url="^http://guide.renren.com/guide$" responseTemplate="response_guide.xsl">
<mdp:bs-rule type="regex" regex="get_check:'([-+]?\d+[-+]?)'" template="$1" />
</mdp:bs-page>
</mdp:bs-config>
<!--<mdp:bs-config source="guide.renren.com" encoding="utf-8">
<mdp:bs-page url="^http://guide.renren.com/guide$" responseTemplate="response_guide.xsl">
<mdp:bs-rule type="tag" mode="replace" regex="get_check:'(\d+)'" replacement="$1" />
</mdp:bs-page>
</mdp:bs-config>
--><mdp:bs-config source="status.renren.com" edcoding="utf-8">
<mdp:bs-page url="^http://status.renren.com/doing/update.do\?$" ></mdp:bs-page>
</mdp:bs-config>
</mdp:configuration>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值