我的$ ajax通话无效

When executing the following code:

url= "http://192.168.2.171/LoginAuthentication";
$.ajax({
    url: 'url',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('a.tsh').text();
        alert(headline);
    }
});

I get this error:

Object XMLHttpRequest cannot load 'url'. Origin null is not allowed by Access-Control-Allow-Origin.
url="http://192.168.2.171/LoginAuthentication";
$.ajax({
    url: url,
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('a.tsh').text();
        alert(headline);
    }
});

But it may not work if you are not making a request to the same domain

Browsers do not allow you to request resources from another domain (images and script files are the notable exceptions to this rule). Refer to this documentation for details and workarounds.