谁能解释一下。 现在有3个页面。A.aspx,B.aspx,C.aspxA页面通过showModalDialog()弹出页面B,在页面B的页面load时候用ajax去请求页面C中得数据。就在B用ajax请求C的时候出现了错误,IE报错是“拒绝访问” firefox 中不报错但是没有响应数据。为啥? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是跨域了吗?js不能跨域如果没有跨域的问题, 你可以这样实现A页面通过showModalDialog()弹出页面X.aspxX.aspx里面写<html><frameset id="sidebar_content" cols="0, *"> <frame src="" /> <frame src="B.aspx"/></frameset></html> 另外,showModalDialog缓存很厉害,注意清空缓存 firefox 不支持showModalDialog吧? 在A 页面中调用这样的方法:function showHABDialog(){ showModalDialog("http://localhost:1211/hab/A.aspx");} 在B页面中:<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(document).ready(function () { $("#b01").click(function () { htmlobj = $.ajax({ url: "http://localhost:2464/C.aspx", async: false }); $("#myDiv").html(htmlobj.responseText); }); }); </script></head><body> <div id="myDiv"><h2>Let AJAX change this text</h2></div><button id="b01" type="button">Change Content</button></body></html>在C页面中只用一行代码 Response.Write("server resource");三个网页是部署在一台IIS上的不同应用程序 恩,但是我不能这么做,其实这里的C页面是我们的wcf服务库,我为了简化模型这么说的,页面B会向C发出多次请求的。 好吧谢谢楼上的,我已经找到原因了,这样是可以访问的,但是B页面是ssl部署的,c不是ssl部署。https:/XXX 去访问 http:// 就出错了 json对象如何动态添加属性 如何强制浏览器打开的默认编码? 下面的javascript代码中,var a={};是什么意思?是定义一个空数组吗?另外:…… 点击冒泡的问题 网页中怎么弹出flash窗口??? 求一个js实现的菜单,菜单内容是读XML的 使用js可否将text框按几个一组集体隐藏或显示?(隐藏时组件还在页面上,只是不显示) 急!再求动态效果 谁有TChart网页应用的例子?在线... easyui datagrid的combobox动态选择后为某单元格赋值 请教个特殊字符转义问题 js如何拿flash版本号?
如果没有跨域的问题, 你可以这样实现
A页面通过showModalDialog()弹出页面X.aspx
X.aspx里面写
<html><frameset id="sidebar_content" cols="0, *">
<frame src="" />
<frame src="B.aspx"/>
</frameset>
</html>
function showHABDialog()
{
showModalDialog("http://localhost:1211/hab/A.aspx");
}
在B页面中:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#b01").click(function () {
htmlobj = $.ajax({ url: "http://localhost:2464/C.aspx", async: false });
$("#myDiv").html(htmlobj.responseText);
});
});
</script>
</head>
<body>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button id="b01" type="button">Change Content</button>
</body>
</html>
在C页面中
只用一行代码 Response.Write("server resource");
三个网页是部署在一台IIS上的不同应用程序
https:/XXX 去访问 http:// 就出错了