
本文共 3651 字,大约阅读时间需要 12 分钟。
���������������������������������������������������������������������������������������������������iferay������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ jQuery ��� 360������API���������������������������������������������������������������������������������������������������������������������������������
������ jQuery ��� 360������API ������������������������
��������������������������������� jQuery ��� AJAX ������ programming interface���API������������ 360������API���������������������������������������������������������������������������������������������������������������������������������������������������������
������������
������������ ���������������������������������������������������������������������������������������������������������������������������������������������API��������������������������� 360SEARCH ���������API������������������������������������������
������������
- JavaScript: ���������������������������������������
- jQuery: ��������������������������������������� DOM ���������������������������
- 360������API: ������������������������������������
- ������������������
- ������ jQuery ���������: ��������� Vue_IA ���������������������������
- ������������������:
- ������������������������
- ���screen button ������������������
- ������������ API: ������ HTTP������������������������������
- ������������������: ��� API ���������������������������������
- ������������: ���������������������������������������
- ������������
$(function() { ... })
: jQuery ��������������������������������� DOM ���������������������- ������������
const $txt = $('#txt01').val();
������������������������- ������������
$.ajax({ ... })
: ������ HTTP ������- url: ������������
- type: GET ��� POST ���������������
- dataType: ������������������������ JSONP
- data: ���������������������������fields ��������� word ��� huid ���
- ������������
done()
������������������������������- ������������: dat Result ���������������������������
- ������������: ������
.empty()
��������������������������� - ������������: ������ jQuery ������������������������������������ flerAppendTo ���������������
- ������������
- ������������������������������������
- ������������: ��������������������������� UTF-8 ������
- ������������: ���������������������������������������
- ������������: ������������������ JSONP������������������������������
- ���������������: ������������������������������������������������������������
- ������������:��llt.attachment_add
- ���������������:
- ���������������:
- ������������:
###������������
$(function() { // ��������������� const $txt = $('#txt01').val(); // ������������ $.ajax({ url: 'https://sug.so.360.cn/suggest', type: 'GET', dataType: 'jsonp', // JSONP ������������������������������������ $.done() data: { word: $txt } }) // ������������������ .done(function(dat) { console.log(dat); // ������������������ $('.content').empty(); // ������������ dat.result.forEach(function(item) { const $li = $('').html(item.word); $li.appendTo('.content'); }); }) // ������������ .fail(function() { alert('������������������������������'); });});
###������������
###������������
###������uppen ���������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
