jquery と ajax 呼び出しを訴える xml ファイルにアクセスしようとしています。Web サーバーで構成を変更しない限り、そのクロスドメイン要求は許可されないことがわかりました。
私はこれをやっています:
$(document).ready(function () {
$("#div1").jstree({
"xml_data": {
"ajax": {
type: "GET",
dataType: 'xml',
url: "http://192.168.101.1/img/tree.xml"
iis web.config ファイルを次のように変更しました。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
II をリサイクルしましたが、まだその xml ファイルにアクセスできません。この問題にどのように取り組むことができますか?