No 'Access-Control-Allow-Origin' header is present on the..
jquery吧
全部回复
仅看楼主
level 2
siliekakaxi 楼主
这是做简单的ajax的实例。。错误代码:
OPTIONS file:///F:/coreaderTest/test.html No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. jquery-1.3.2.min.js:19
XMLHttpRequest cannot load file:///F:/coreaderTest/test.html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
主页代码:
2014年12月29日 11点12分 1
level 2
siliekakaxi 楼主
<head>
<title></title>
<script src="lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function(){
$('input').click(function ()
{
$('#box').load('test.html');
});
});
</script>
<style type="text/css">
body{ padding:5px; margin:0; padding-bottom:15px;}
#layout1{ width:100%;margin:0; padding:0; }
.l-page-top{ height:80px; background:#f8f8f8; margin-bottom:3px;}
h4{ margin:20px;}
</style>
</head>
<body style="padding:10px">
<input type="button" value="异步获取数据">
<div id="box"></div>
</body>
</html>
2014年12月29日 11点12分 2
level 2
siliekakaxi 楼主
求指导。我本机运行网页。看视频也没哟开启服务器。。。怎么打不开。。。求交流。!!
2014年12月29日 11点12分 3
我也遇到了一抹一样的问题,求楼主分享
2016年12月29日 02点12分
晕。后来没有研究。我也没有弄明白。。。
2017年02月11日 07点02分
1