死神 请问死神黑崎一护换成天锁斩月之后,天锁斩月的人型是第几集出现的,就像斩月大叔

死神黑崎一护

燃谷 燃谷
回答
  • 简单 简单

    如果跨域使用post方式,可以使用创建一个隐藏的iframe来实现,与ajax上传图片原理一样,但这样会比较麻烦。因此,通过设置access-control-allow-origin来实现跨域访问比较简单。例如:客户端的域名是www.client.com,而请求的域名是www.server.com
    如果直接使用ajax访问,会有以下错误
    xmlhttprequest cannot load http://www.server.com/server.php. no 'access-control-allow-origin' header ** present on the requested resource.origin 'http://www.client.com' ** therefore not allowed access.
    在被请求的response header中加入
    [php]view plain copy
    指定允许其他域名访问
    header('access-control-allow-origin:*');响应类型
    header('access-control-allow-methods:post');响应头设置
    header('access-control-allow-headers:x-requested-with,content-type');就可以实现ajax post跨域访问了。代码如下:
    client.html 路径:http://www.client.com/client.html
    [html]view plain copy
    doctypehtml public "-//w3c//dtdhtml 4.0 transitional//en">html;charset=utf-8">
    跨域测试com/jquery-1.11.3.min.js"></script>
    div>
    post("http://www.server.com/server.php",{name:"fdipzone",gender:"male"})
    done(function(data){
    document.getelementbyid("show").innerhtml=data.name+' '+data.gender;});server.php 路径:http://www.server.com/server.php
    [php]view plain copy
    php
    ret=array
    'name'=>**set($_post['name'])?post['name']:'',
    'gender'=>**set($_post['gender'])?post['gender']:''
    header('content-type:application:json;charset=utf8');header('access-control-allow-origin:*');header('access-control-allow-methods:post');header('access-control-allow-headers:x-requested-with,content-type');echo json_encode($ret);access-control-allow-origin:*表示允许任何域名跨域访问如果需要指定某域名才允许跨域访问,只需把access-control-allow-origin:*改为access-control-allow-origin:允许的域名
    例如:header('access-control-allow-origin:http://www.client.com');如果需要设置多个域名允许访问,这里需要用php处理一下
    例如允许 www.client.com 与 www.client2.com 可以跨域访问
    server.php 修改为
    [php]view plain copy
    php
    ret=array
    'name'=>**set($_post['name'])?post['name']:'',
    'gender'=>**set($_post['gender'])?pos

类似问答
精品推荐

友情链接

友链互换QQ:

谷财 备案编号:蜀ICP备11019336号-3商务合作:235-677-2621

Copyright 2009-2020 Chengdu Sanzilewan Technology Co.,Ltd all rights reserve

抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当 适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活