• 知识巩固——跨域,http与https


    跨域

    1、jsonp

      仅支持get请求,不支持post,因为实践中没用到过,真的不知道啊

      用法估计:服务器,比如js文件user('soc');

           客户端  html引用了上面的js  比如www.xx.com/user.js    并在此html有函数

            function user(name){  console.log(name);  } 

    2、iframe

    src     get

    一般都是后端设置请求头的啊,java/php/node.js都是啊

      php——header("Access-Control-Allow-Origin: http://a.com"); 

      node——express

    app.all('*', function(req, res, next) {
        res.header("Access-Control-Allow-Origin", "*");
        res.header("Access-Control-Allow-Headers", "X-Requested-With");
        res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
        res.header("X-Powered-By",' 3.2.1');
        res.header("Content-Type", "application/json;charset=utf-8");
        next();
    });

      java——...........................................

    flash

    iframe

    h5 postmessage

    
    
  • 相关阅读:
    商业数据分析第七记
    商务数据分析第六记
    商业数据分析第五记
    学英语
    商业数据分析第四记
    商业数据分析第三记
    商业数据分析第二记
    SQL 存储过程笔记
    Java(Android)线程池
    android ImageView 宽度设定,高度自适应
  • 原文地址:https://www.cnblogs.com/hhweb/p/7217515.html
Copyright © 2020-2023  润新知