P
P
Perkovec2014-04-09 15:36:42
JavaScript
Perkovec, 2014-04-09 15:36:42

How to fix an error when parsing an XML document with jQuery?

I'm trying to parse an xml file that is on the server using jQuery.

$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: "Ссылка на xml файл",
        dataType: "xml",
        success: xmlParser
    });
});

And chrome gives this error
XMLHttpRequest cannot load "link to xml file". No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. there was an answer about this, Klats
was sent here . But I did not understand what and where to insert.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2014-04-09
@mututunus

If the request is cross-domain, it can only be received via jsonp.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question