![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
文章平均质量分 51
Tirzano
这个作者很懒,什么都没留下…
展开
-
jQuery Ajax 跨域前端实现登录
封装好的请求对象(function() { var ajax = { ajax_cors: function(url, data, fn, dataType, contentType) { $.ajaxSetup({ type: 'post', dataType: dataType == null ? 'json' : dataType, global: true, contentType: contentType == null ? 'application原创 2021-01-02 02:30:28 · 451 阅读 · 2 评论 -
Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight respon
一、问题:跨域请求中包含自定义header字段时,浏览器console报错。Request header field xfilesize is not allowed by Access-Control-Allow-Headers1 想要实现前后分离,首先得跨域2 怎么跨域,在后端中 servlet 或 filter 设置请求头,然后就出问题了3 has been blocked by CORS policy: Request header field content-type is not a原创 2021-01-02 02:23:16 · 773 阅读 · 0 评论 -
vue axios 跨域配置
devServer: { disableHostCheck: true, host:'http://127.0.0.1',// 前端地址 port:'8020', proxy: { '/api':{ target:'http://127.0.0.1:8080',// 后端地址 changeOrigin:true, pathRe原创 2020-12-30 16:51:04 · 412 阅读 · 0 评论 -
javascript自定义全局函数
// ()() 执行匿名函数 不开严格模式 this默认指向window(function () { "use strict"; var strType = function (obj, type, str) { if (obj === undefined) { return typeof obj; } if (obj === null) { return typeof obj;原创 2020-12-27 15:33:40 · 1956 阅读 · 0 评论 -
Jquery + Bootstrap 实现搜索框
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="./css/b原创 2020-12-26 18:44:41 · 643 阅读 · 0 评论 -
Ajax学习
js原生发送请求var http = new XMLHttpRequest();GET 请求http.open("GET","/kongjs.com?username=jieke",true);http.send();POST 请求http.open("POST","/kongjs.com",true);http.setRequestHeader("Content-type","application/x-www-form-urlencoded");http.send("username=k原创 2020-12-25 14:34:26 · 118 阅读 · 0 评论 -
Java程序员要学的JavaScript总结ES5
JavaScript输出<script> <!--弹出警告框--> window.alert(); <!--将内容写到 HTML 文档中--> document.write(); <!--写入到 HTML 元素--> innerHTML=; <!--写入到 HTML 文本--> innerText=; <!--打印到浏览器的控制台--> console.log();</script>Java原创 2020-12-10 09:48:17 · 314 阅读 · 0 评论