
正文
新版 Chrome Ajax 跨域调试
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
一、前言
web 开发中 Ajax 是十分常见的技术,但是在前后端使用接口对接的调试过程中不可避免会碰到跨域问题。今天我给大家介绍一个十分简单有效的方法。
跨域经典错误
二、Chrome 跨域设置
-
首先创建一个文件夹用来存储 Chrome 的配置文件
-
拼接参数
--disable-web-security --user-data-dir=创建的文件夹绝对路径
如
--disable-web-security --user-data-dir=C:\appconfig\chromeconfig
-
找到Chrome桌面快捷方式=》鼠标右键=》属性
界面如下(将上面参数粘贴到箭头所指位置,注意有空格)
点击应用,并确定
-
测试
双击修改后的快捷方式(出现下面提示表示设置成功)
成功跨域获取到数据
至此,Chrome 跨域调试配置完成。
限于笔者技术,文章观点难免有不当之处,希望发现问题的朋友帮忙指正,笔者将会及时更新。也请转载的朋友注明文章出处并附上原文链接,以便读者能及时获取到文章更新后的内容,以免误导读者。笔者力求避免写些晦涩难懂的文章(虽然也有人说这样显得高逼格,专业),尽量使用简单的用词和例子来帮助理解。如果表达上有好的建议的话也希望朋友们在评论处指出。
本文为作者原创,转载请注明出处! Cboyce
/* RESET =============================================================================*/ html, div, span, applet, object, iframe, h2, h3, h4, h5, h6, p, blockquote, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; } /* BODY =============================================================================*/ body>*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl { margin: 15px 0; } /* HEADERS =============================================================================*/ h2, h3, h4, h5, h6 { margin: 20px 0 10px; padding: 0; font-weight: bold; -webkit-font-smoothing: antialiased; } , h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { font-size: inherit; } h2 { font-size: 24px; border-bottom: 1px solid #ccc; color: #000; } h3 { font-size: 18px; } h4 { font-size: 16px; } h5 { font-size: 14px; } h6 { color: #777; font-size: 14px; } a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0; padding-top: 0; } h2+p, h3+p, h4+p, h5+p, h6+p { margin-top: 10px; } /* LINKS =============================================================================*/ a { color: #4183C4; text-decoration: none; } a:hover { text-decoration: underline; } /* LISTS =============================================================================*/ ul, ol { padding-left: 30px; } ul li > :first-child, ol li > :first-child, ul li ul:first-of-type, ol li ol:first-of-type, ul li ol:first-of-type, ol li ul:first-of-type { margin-top: 0px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } dl { padding: 0; } dl dt { font-size: 14px; font-weight: bold; font-style: italic; padding: 0; margin: 15px 0 5px; } dl dt:first-child { padding: 0; } dl dt>:first-child { margin-top: 0px; } dl dt>:last-child { margin-bottom: 0px; } dl dd { margin: 0 0 15px; padding: 0 15px; } dl dd>:first-child { margin-top: 0px; } dl dd>:last-child { margin-bottom: 0px; } /* CODE =============================================================================*/ kbd { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background-color: #DDDDDD; background-image: linear-gradient(#F1F1F1, #DDDDDD); background-repeat: repeat-x; border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD; border-image: none; border-radius: 2px 2px 2px 2px; border-style: solid; border-width: 1px; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; line-height: 10px; padding: 1px 4px; } /* QUOTES =============================================================================*/ blockquote { border-left: 4px solid #DDD; padding: 0 15px; color: #777; } blockquote>:first-child { margin-top: 0px; } blockquote>:last-child { margin-bottom: 0px; } /* HORIZONTAL RULES =============================================================================*/ hr { clear: both; margin: 15px 0; height: 0px; overflow: hidden; border: none; background: transparent; border-bottom: 4px solid #ddd; padding: 0; } /* TABLES =============================================================================*/ /* IMAGES =============================================================================*/ img { max-width: 100% } .cj-img-container { text-align: center; };
.cj-img-container img{
max-width:700px;}
.cj-img{
text-align:center;
}
.cj-img img{
width:50%;
}
#cnblogs_post_body img{max-width:700px;}







