ajax 请求域名不同session问题
s.com 域名下有一文件process.asp
VBScript code:
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
Response.charset="gb2312"
response.Write Session("UserID")
想要在h.com下用ajax来访问
VBScript code:
response.Write getHTTPPage("http://s.com/process.asp")
Function getHTTPPage(url)
dim http
set http=Server.createobject("Msxml2.ServerXMLHTTP")
Http.open "get",url,false
Http.send()
if Http.readystate<>4 then
getHTTPPage = "error"
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then Response.write(err.number)
End function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End F
相关问答:
<div id="div6" runat="server" style= "height:auto;width:auto; text-align: left;">
& ......
ajax使用中遇到几个问题,请各位帮忙。
1、使用 alert(xmlhttp.responsetext); 弹出的却是整个页面的HTML文本。
2、使用xmlhttp发出的请求,在另一页面的Page_Load里,通过语句得到一个表的值,如何将这个 ......
假如一个页面上有N个操作,都要用AJAX 不用控件,自己写JS
例如 <a href="#" onclick="">aaaa </a>
<a href="#" onclick= ......
本人今天刚开始弄ajax
服务器 tomcat 6.0 浏览器 遨游2
p1.jsp如下
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding=" ......
JS 文件
var test={
show:function(){
var userifo=new Array();
userifo.push(1);
userifo.push(2);
userifo.push(3);
//alert("aaa");
$. ......