如何解决 ajax 跨域 问题 如题,??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用JQ的AJAXhttp://www.cnblogs.com/yjmyzz/archive/2008/09/23/1296818.html 写个php来获取跨域的信息,然后再用ajax向这个php请求。说的不对望楼下更正 百度的跨域处理http://topic.csdn.net/u/20081224/09/26aff992-d0ba-4f6f-a023-e0e96ecbe1fc.html php+js的例子:域名http://mydir.comtest.php内容:<?phpecho 'a';域名http://mytest.comindex.html内容:<script src="jquery.js"></script><script>$.post("index.php", {}, function(data){alert(data);//输出的是a});</script>index.php内容:<phpini_set('allow_url_include', 'On');include('http://mydir.com/test.php');这样轻松实现ajax跨域操作 用 img 或者 script 标签 的 src可以跨域请求 一般意义上的ajax是不能跨域的。但可以用类似ajax的方法来达到无刷新跨域的效果动态创建script的方法var scripts = document.createElement("script");scripts.src = "xxxx.php";document.getElementsByTagName("head")[0].appendChild(scripts); jquery的getJSON支持跨域url后面跟jsoncallback=? Ext show方法为什么不管用 求一个EXTJS与AJAX的例子 关于密码登陆时候怎么做到输入时候,显示最后一位? 很酷的鼠标移动显示提示信息 急,请问javascript对象的小问题? 100分求css和js效果=====晕了,最多只能弄100分的帖子,好的再追加600分== innerHTML为什么会自动添加“http://localhost/”? 求书? 正则表达式的问题,梅花雪请进。 像怎么怎么对图片进行操作!?(急) 【急】textarea高度自适应的问题 按钮控制DIV中内容左右移动
http://www.cnblogs.com/yjmyzz/archive/2008/09/23/1296818.html
说的不对望楼下更正
http://topic.csdn.net/u/20081224/09/26aff992-d0ba-4f6f-a023-e0e96ecbe1fc.html
域名http://mydir.com
test.php内容:
<?php
echo 'a';域名http://mytest.com
index.html内容:
<script src="jquery.js"></script>
<script>
$.post("index.php", {}, function(data){
alert(data);//输出的是a
});
</script>index.php内容:
<php
ini_set('allow_url_include', 'On');
include('http://mydir.com/test.php');
这样轻松实现ajax跨域操作
var scripts = document.createElement("script");
scripts.src = "xxxx.php";
document.getElementsByTagName("head")[0].appendChild(scripts);