JQuery UI bilan oddiy uzoqdan ma'lumot avtomatik yakunlanadi?

Nima uchun quyidagi kod ishlamaydi? (agar u uzoqdan manbaani mahalliy joyga o'zgartirsa, u yaxshi ishlaydi)

<!DOCTYPE HTML>
<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  <script>
  $(document).ready(function() {
    $("input#autocomplete").autocomplete({
      source: "http://jqueryui.com/demos/autocomplete/search.php",
            minLength: 2,
            select: function( event, ui ) {
            }

    });
  });
  </script>
    
  
</head>
<body style="font-size:62.5%;">

<input id="autocomplete" />

</body>
</html>
0

1 javoblar

manba sifatida bir xil chiqish siyosati boshqa saytdan ishlaydigan buyruq faylini talab qiladi.

http://en.wikipedia.org/wiki/Same_origin_policy

Agar jQuery ajax chaqiruvini jsonp-i qaytara oladigan boshqa saytga ishlatish uchun manbani o'zgartirishi mumkin.

See this for an example: http://jqueryui.com/demos/autocomplete/#remote-jsonp

yoki berilgan manbaning urlini jsonp qaytishini ta'minlash.

1
qo'shib qo'ydi