How do I get the content of this xml page?

http://2011.cma.gov.cn/qxxw/y.

I use jquery

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script src="http://127.0.0.1/jquery-3.3.1.js"></script>
    <script>
function Ajax( ) {
     var url = "http://2011.cma.gov.cn/qxxw/yw/index_228.xml";
      $.ajax(url, {
        type:"GET",
        dataType: "jsonp",
        crossDomain: true,
            success:function(data){  
                alert(data);
            },
            error: function (e) {
                alert("error");
            }

      });
};
    </script>
  
    <input type="button" value="show content" onclick="Ajax();" />    

</body>
</html>

Why did I report an error and how to correct it?

May.15,2021

The content of

xml cannot be obtained through jsonp . The principle of jsonp is to introduce data as js through script .

you can consider the way of proxy and let the server get it.


jsonp is supported by the server, not the


that you want to use.

dataType should be xml

the code is as follows:

function Ajax( ) {
     var url = 'http://2011.cma.gov.cn/qxxw/yw/index_228.xml';
      $.ajax(url, {
        type:"GET",
        dataType: 'xml',
        crossDomain: true,
            success:function(data){  
                alert(data);
            },
            error: function (e) {
                alert("error");
            }

      });
};
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b363dc-4d697.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b363dc-4d697.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?