pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    • <bdo id='97iOt'></bdo><ul id='97iOt'></ul>

      <i id='97iOt'><tr id='97iOt'><dt id='97iOt'><q id='97iOt'><span id='97iOt'><b id='97iOt'><form id='97iOt'><ins id='97iOt'></ins><ul id='97iOt'></ul><sub id='97iOt'></sub></form><legend id='97iOt'></legend><bdo id='97iOt'><pre id='97iOt'><center id='97iOt'></center></pre></bdo></b><th id='97iOt'></th></span></q></dt></tr></i><div class="wy66gko" id='97iOt'><tfoot id='97iOt'></tfoot><dl id='97iOt'><fieldset id='97iOt'></fieldset></dl></div>

      <small id='97iOt'></small><noframes id='97iOt'>

    1. <tfoot id='97iOt'></tfoot>

        <legend id='97iOt'><style id='97iOt'><dir id='97iOt'><q id='97iOt'></q></dir></style></legend>

        Github API 和 Access-Control-Allow-Origin

        Github API and Access-Control-Allow-Origin(Github API 和 Access-Control-Allow-Origin)
        1. <tfoot id='7HwZU'></tfoot>

              • <bdo id='7HwZU'></bdo><ul id='7HwZU'></ul>
                <i id='7HwZU'><tr id='7HwZU'><dt id='7HwZU'><q id='7HwZU'><span id='7HwZU'><b id='7HwZU'><form id='7HwZU'><ins id='7HwZU'></ins><ul id='7HwZU'></ul><sub id='7HwZU'></sub></form><legend id='7HwZU'></legend><bdo id='7HwZU'><pre id='7HwZU'><center id='7HwZU'></center></pre></bdo></b><th id='7HwZU'></th></span></q></dt></tr></i><div class="ykmm8cu" id='7HwZU'><tfoot id='7HwZU'></tfoot><dl id='7HwZU'><fieldset id='7HwZU'></fieldset></dl></div>
              • <small id='7HwZU'></small><noframes id='7HwZU'>

                  <tbody id='7HwZU'></tbody>

                • <legend id='7HwZU'><style id='7HwZU'><dir id='7HwZU'><q id='7HwZU'></q></dir></style></legend>

                • 本文介紹了Github API 和 Access-Control-Allow-Origin的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這可能是一個簡單的(一系列)問題,但我無法理解它.

                  this probably is a simple (series of) question(s) but I can't wrap my head around it.

                  我正在嘗試從我網站上托管的網絡應用程序訪問 github api.簡而言之,這是代碼:

                  I'm trying to access the github api from a web app hosted on my site. This is the code in a nutshell:

                  <!DOCTYPE html>
                  <html>
                  <head>
                    <style>p { color:red; }</style>
                    <script src="http://code.jquery.com/jquery-latest.js"></script>
                    <script>
                    $(document).ready(function () {
                  
                  $.ajax( {url :'https://api.github.com/repos/janesconference/kievIIPlugins/commits', dataType: "json", cache: false, success: function (data, textStatus, jqXHR)
                          {
                              var lastCommitSha = data[0].sha;
                              $("p").text("Last commit SHA: " + lastCommitSha);
                          }
                      });
                  });
                    </script>
                  
                  </head>
                  <body>
                    <p>Ajax request not (yet) executed.</p>
                  
                  </body>
                  </html>
                  

                  如果我將瀏覽器指向在我的 Dropbox 帳戶上上傳的這個簡單頁面一切都好.相反,如果我將瀏覽器指向 在我的網站上 上傳的這個簡單頁面,我會得到臭名昭著的 Access-Control-Allow-Origin 異常:

                  If I point my browser to this simple page uploaded on my dropbox account everything is ok. If, instead, I point my browser to this simple page uploaded on my site, I get the infamous Access-Control-Allow-Origin exception:

                  XMLHttpRequest cannot load https://api.github.com/repos/janesconference/kievIIPlugins/commits?_=1360060011783. Origin http://bitterspring.net is not allowed by Access-Control-Allow-Origin.
                  

                  所以,問題:

                  • 為什么它可以在 Dropbox 上運行?
                  • 我了解使用 CORS 甚至可以在網站上使用.這是將 Access-Control-Allow-Origin: *.github.com 放在我的 Apache 配置或類似的東西上的問題.但是,正如 en.wiki 所引用的,
                  • Why does it work on Dropbox?
                  • I understand that with CORS it would work even on the website. This is a matter of putting Access-Control-Allow-Origin: *.github.com on my Apache configuration or something like that. But, as quoted from en.wiki,

                  但是,這可能不適合涉及安全問題的情況

                  However, this might not be appropriate for situations in which security is a concern

                  • 有沒有辦法在不更改 Apache 配置的情況下做到這一點?可能,我無法觸摸托管站點的 Apache conf,并且總是存在安全問題.這樣做的正確方法是什么?
                  • 推薦答案

                    為了讓 CORS 為您的網站工作(例如 http://example.com),您必須通過在此處創建 GitHub OAuth 應用程序來啟用它:https://github.com/settings/applications

                    In order to get CORS working for your site (e.g. http://example.com), you have to enable it by creating a GitHub OAuth application here: https://github.com/settings/applications

                    由于您使用 GitHub 應用程序來使 CORS 工作(不使用它來啟用 OAuth 本身),您只需在創建申請表"的所有三個字段中輸入您網站的 URL:

                    Since you are using a GitHub applications to get CORS to work (not using it for enabling OAuth itself), you can just enter your site's URL in all three fields in the "Create Application form":

                    • 名稱:http://example.com
                    • 網址:http://example.com
                    • 回調網址:http://example.com

                    請注意,如果您打算使用 OAuth 功能,則需要以不同的方式設置回調 URL.

                    Note that if you intend to use OAuth functionality, you need to setup Callback URL differently.

                    在此之后,您應該能夠從您的站點 http://example.com 向 GitHub API 發送 AJAX 請求.

                    After this, you should be able to send AJAX requests to GitHub APIs from your site http://example.com.

                    這篇關于Github API 和 Access-Control-Allow-Origin的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                    【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  XmlHttpRequest onprogress interval(XmlHttpRequest onprogress 間隔)
                  How can I modify the XMLHttpRequest responsetext received by another function?(如何修改另一個函數接收到的 XMLHttpRequest 響應文本?)
                  What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get(XMLHttpRequest、jQuery.ajax、jQuery.post、jQuery.get 有什么區別)
                  1. <i id='WFq5L'><tr id='WFq5L'><dt id='WFq5L'><q id='WFq5L'><span id='WFq5L'><b id='WFq5L'><form id='WFq5L'><ins id='WFq5L'></ins><ul id='WFq5L'></ul><sub id='WFq5L'></sub></form><legend id='WFq5L'></legend><bdo id='WFq5L'><pre id='WFq5L'><center id='WFq5L'></center></pre></bdo></b><th id='WFq5L'></th></span></q></dt></tr></i><div class="qm2uiei" id='WFq5L'><tfoot id='WFq5L'></tfoot><dl id='WFq5L'><fieldset id='WFq5L'></fieldset></dl></div>

                        <bdo id='WFq5L'></bdo><ul id='WFq5L'></ul>
                          <tbody id='WFq5L'></tbody>

                        <small id='WFq5L'></small><noframes id='WFq5L'>

                      • <tfoot id='WFq5L'></tfoot>

                        • <legend id='WFq5L'><style id='WFq5L'><dir id='WFq5L'><q id='WFq5L'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 全屋整木定制-橱柜,家具定制-四川峨眉山龙马木业有限公司 | 换链神器官网-友情链接交换、购买交易于一体的站长平台 | 搪瓷反应釜厂家,淄博搪瓷反应釜-淄博卓耀| 济南冷库安装-山东冷库设计|建造|冷库维修-山东齐雪制冷设备有限公司 | 快干水泥|桥梁伸缩缝止水胶|伸缩缝装置生产厂家-广东广航交通科技有限公司 | 上海电子秤厂家,电子秤厂家价格,上海吊秤厂家,吊秤供应价格-上海佳宜电子科技有限公司 | 热回收盐水机组-反应釜冷水机组-高低温冷水机组-北京蓝海神骏科技有限公司 | 曙光腾达官网-天津脚手架租赁-木板架出租-移动门式脚手架租赁「免费搭设」 | 海南在线 海南一家| 家乐事净水器官网-净水器厂家「官方」| 青岛代理记账_青岛李沧代理记账公司_青岛崂山代理记账一个月多少钱_青岛德辉财税事务所官网 | 合肥制氮机_合肥空压机厂家_安徽真空泵-凯圣精机 | 闭端端子|弹簧螺式接线头|防水接线头|插线式接线头|端子台|电源线扣+护线套|印刷电路板型端子台|金笔电子代理商-上海拓胜电气有限公司 | 黑龙江京科脑康医院-哈尔滨精神病医院哪家好_哈尔滨精神科医院排名_黑龙江精神心理病专科医院 | 扬州汇丰仪表有限公司| Eiafans.com_环评爱好者 环评网|环评论坛|环评报告公示网|竣工环保验收公示网|环保验收报告公示网|环保自主验收公示|环评公示网|环保公示网|注册环评工程师|环境影响评价|环评师|规划环评|环评报告|环评考试网|环评论坛 - Powered by Discuz! | 撕碎机,撕破机,双轴破碎机-大件垃圾破碎机厂家 | 博莱特空压机|博莱特-阿特拉斯独资空压机品牌核心代理商 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 伶俐嫂培训学校_月嫂培训班在哪里报名学费是多少_月嫂免费政府培训中心推荐 | 润滑油加盟_润滑油厂家_润滑油品牌-深圳市沃丹润滑科技有限公司 琉璃瓦-琉璃瓦厂家-安徽盛阳新型建材科技有限公司 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | 雨燕360体育免费直播_雨燕360免费NBA直播_NBA篮球高清直播无插件-雨燕360体育直播 | 活性氧化铝|无烟煤滤料|活性氧化铝厂家|锰砂滤料厂家-河南新泰净水材料有限公司 | 大鼠骨髓内皮祖细胞-小鼠神经元-无锡欣润生物科技有限公司 | 建筑消防设施检测系统检测箱-电梯**检测仪器箱-北京宇成伟业科技有限责任公司 | 粉末包装机,拆包机厂家,价格-上海强牛包装机械设备有限公司 | 南京兰江泵业有限公司-水解酸化池潜水搅拌机-絮凝反应池搅拌机-好氧区潜水推进器 | 土壤墒情监测站_土壤墒情监测仪_土壤墒情监测系统_管式土壤墒情站-山东风途物联网 | 龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司_龙门加工中心-数控龙门加工中心厂家价格-山东海特数控机床有限公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 电动百叶窗,开窗器,电动遮阳百叶,电动开窗机生产厂家-徐州鑫友工控科技发展有限公司 | 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | 海外整合营销-独立站营销-社交媒体运营_广州甲壳虫跨境网络服务 焊管生产线_焊管机组_轧辊模具_焊管设备_焊管设备厂家_石家庄翔昱机械 | 杭州网络公司_百度SEO优化-外贸网络推广_抖音小程序开发-杭州乐软科技有限公司 | 蜗轮丝杆升降机-螺旋升降机-丝杠升降机厂家-润驰传动 | 澳威全屋定制官网|极简衣柜十大品牌|衣柜加盟代理|全屋定制招商 百度爱采购运营研究社社群-店铺托管-爱采购代运营-良言多米网络公司 | 对夹式止回阀厂家,温州对夹式止回阀制造商--永嘉县润丰阀门有限公司 | 背压阀|减压器|不锈钢减压器|减压阀|卫生级背压阀|单向阀|背压阀厂家-上海沃原自控阀门有限公司 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 德州网站开发定制-小程序开发制作-APP软件开发-「两山开发」 | 薄壁轴承-等截面薄壁轴承生产厂家-洛阳薄壁精密轴承有限公司 |