JQuery UI autocomplete自动补全插件搜索结果去除提示

目录

JQuery UI autocomplete自动补全插件搜索结果去除提示

背景

最近有个后台管理系统要用到自动检索并补全信息的功能,所以我就用到JQuery UI的autocomplete插件,插件挺好用的,api也讲解也挺全的,学习成本低,如果大家有自动补全功能的需求可以去看看。在功能基本完成之后我发现这个自动补全搜索出来的结果总是在结果的最上面出现一行英文的提示,大致意思是告知用户搜索的结果符合要求的有多少条,虽然是一片好心但是导致样式一点都不好看,如下图:

 

解决方案

  • jqueryui中搜索menufocus,把这个绑定注掉如下: /*menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one(“mousemove”,function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data(“ui-autocomplete-item”),!1!==this._trigger(“focus”,e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr(“aria-label”)||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t(“<div>”).text(s).appendTo(this.liveRegion)),void 0)},*/
  • 代码末尾message

 

$('#company').autocomplete({
    source: function (query, process) {
        var cityVal = $('#city').val();
        if (cityVal > 0) {
            $.ajax({
                type: 'POST',
                dataType: 'json',
                url: '${pageContext.request.contextPath}/companyGrade/getCompanyInfo',
                data: {
                    'cityId': cityVal,
                    'searchParam': $('#company').val()
                },
                success: function (data) {
                    if (data.code == 1) {
                        process($.map(data.data, function (item) {
                            return {
                                label: item.companyName,
                                value: item.companyName,
                                companyId: item.companyId
                            }
                        }));
                    } else {
                        return;
                    }
                },
                error: function () {
                    alert('网络异常 请稍后再试');
                }
            });
        } else {
            alert("请先选择城市");
            return;
        }
    },

    select: function (event, ui) {
        $('#comId').val(ui.item.companyId);
        $.ajax({
            type: 'POST',
            dataType: 'json',
            url: '${pageContext.request.contextPath}/companyGrade/getCompanyGrade',
            data: {
                'companyId': ui.item.companyId
            },
            success: function (data) {
                $('#comId').val(ui.item.companyId);
                if (data.code == 1) {
                    $('#infoPercent').val(data.data.companyInfoPercent);
                } else {
                    $('#infoPercent').val('');
                }
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                alert('网络异常 请稍后再试');
            }
        });
    },
    messages: {
        noResults: '',
        results: function () {}
    }
});

 

 

93 Responses

  1. Feqgac说道:

    order lasix 40mg generic buy furosemide generic buy ventolin tablets

  2. Mknjlk说道:

    purchase lexapro online cheap order naltrexone 50 mg without prescription buy naltrexone 50 mg sale

  3. Yqmydr说道:

    buy generic strattera online zoloft 100mg canada oral zoloft

  4. Euyyvk说道:

    urso pills buy ursodiol pills buy zyrtec

  5. Eemist说道:

    zithromax 250mg sale omnacortil 5mg usa neurontin 100mg drug

  6. Ecuiem说道:

    immediate heartburn relief medicine prescribed medicine for acid reflux causes for excessive gastrointestinal flatus

  7. Ufsbqy说道:

    buy deltasone 5mg for sale generic prednisone 40mg order amoxicillin 500mg

  8. Hlhjee说道:

    can you buy estrogen online will viagra help me ejaculate will viagra make you last longer

  9. Pbqxke说道:

    treatment for erosive gastritis boots online doctor login gram negative bacilli antibiotic coverage

  10. Xfuxtv说道:

    purchase duloxetine order modafinil generic modafinil pills

  11. Duidau说道:

    clear fungus where to buy blood pressure medication list alphabetically blood pressure medications list names

  12. Mskikd说道:

    buy generic periactin over the counter buy nizoral generic purchase ketoconazole online cheap

  13. Mwejns说道:

    herpesyl capsules pills for herpes can you get valtrex online diabetic pills type 2

  14. Urxvuz说道:

    order medroxyprogesterone 5mg pills microzide medication order hydrochlorothiazide generic

  15. Lkhxju说道:

    prescription drugs to quit smoking buy prescription pain pills online painkillers in order of strength

  16. Qsfdwz说道:

    order femara 2.5 mg without prescription order generic aripiprazole 30mg order aripiprazole 20mg sale

  17. Sgdntz说道:

    sleeping pills to buy online free online weight loss doctor diet master pills from mexico

  18. Rufzoz说道:

    minocin medication buy requip pills requip medication

  19. Crrptj说道:

    uroxatral pills order uroxatral 10mg online best medicine for painful heartburn

  20. Ovygim说道:

    cheap clonidine 0.1mg buy spiriva 9 mcg for sale order spiriva 9mcg generic

  21. Zhydht说道:

    acne medicine prescribed by doctors acne treatment for teens dermatology trileptal pill

  22. Lfquid说道:

    rocaltrol pills order rocaltrol 0.25mg generic fenofibrate 160mg oral

  23. Ygtbuz说道:

    buy an essay paper politics dissertation suprax 200mg cheap

  24. Ebysbl说道:

    help with essays real online casino black jack card game free

  25. Nosvkv说道:

    aspirin cheap free no deposit usa sugarhouse casino online

  26. Pfsbxd说道:

    buy lamisil tablets free casino cash no deposit free blackjack games

  27. Lmxwnj说道:

    trazodone without prescription sildenafil ca order clindamycin generic

  28. Yhnpny说道:

    order ceftin 500mg sale buy generic ceftin 500mg cost robaxin

  29. Sjeoww说道:

    generic tadalafil 10mg purchase indocin buy indomethacin 75mg pill

  30. Bpbggt说道:

    cheap tamoxifen betahistine 16 mg generic buy rhinocort without a prescription

  31. Ovyvqn说道:

    retin gel us cost tadalafil 20mg avanafil 100mg over the counter

  32. Xgximu说道:

    buy cleocin 300mg without prescription sildenafil 100mg ca order sildenafil generic

  33. Mduefk说道:

    purchase lamictal sale vermox online order buy nemazole pill

  34. Fqlvzt说道:

    aurogra 100mg ca buy cheap generic sildalis estrace 1mg brand

  35. Njgdde说道:

    order fluconazole 200mg pill order ciprofloxacin online buy cipro generic

  36. Ysfuiu说道:

    academic writing buy custom research paper help me write my research paper

  37. Xjjeyl说道:

    order spironolactone aldactone online buy proscar sale

  38. Rfhxvl说道:

    order motilium 10mg generic buy coreg online cheap sumycin 250mg pill

  39. Updeyc说道:

    flomax 0.2mg price buy zofran 8mg simvastatin for sale

  40. Vvtojm说道:

    purchase buspirone online buy zetia 10mg generic cordarone 200mg

  41. Wbewss说道:

    buy generic zantac 150mg buy mobic 7.5mg online celebrex 200mg without prescription

  42. Rjdbfq说道:

    zyloprim 100mg price clobetasol without prescription crestor 20mg oral

  43. Rzfinv说道:

    buy imitrex 25mg sale levaquin 250mg generic order dutasteride generic

  44. Ohgqfu说道:

    generic nexium buy topiramate generic generic topamax 100mg

  45. Rrbnyv说道:

    azelastine 10ml canada zovirax 800mg ca buy generic avalide

  46. Hzdtop说道:

    pepcid 40mg oral cheap pepcid 20mg tacrolimus price

  47. Pksbpe说道:

    order xenical order asacol online cheap order diltiazem online

  48. Pzqkqp说道:

    buy warfarin 5mg generic generic paxil 10mg where to buy metoclopramide without a prescription

  49. Glwruy说道:

    amaryl brand buy glimepiride 1mg for sale etoricoxib online buy

  50. Dhglla说道:

    buy nortriptyline medication nortriptyline pill buy paracetamol pills for sale

  51. Fhrsxl说道:

    inderal 20mg canada propranolol oral plavix 150mg us

  52. Todhco说道:

    buy alendronate without prescription colchicine 0.5mg sale purchase nitrofurantoin generic

  53. Lpbmuw说道:

    buy lioresal paypal baclofen 25mg sale order toradol 10mg pill

  54. Qrhlry说道:

    buy loratadine order dapoxetine 60mg pills order dapoxetine 60mg without prescription

  55. Ndocuc说道:

    order lioresal toradol 10mg pill toradol cheap

  56. Gxlyuq说道:

    aceon 4mg without prescription aceon price buy fexofenadine generic

  57. Kgopwx说道:

    dilantin pills order ditropan 2.5mg generic purchase oxybutynin for sale

  58. Hpjuyc说道:

    buy levitra cheap tizanidine for sale tizanidine oral

  59. Rrwqeb说道:

    methylprednisolone 8 mg tablet triamcinolone 10mg drug aristocort for sale

  60. Gwuxup说道:

    buy clomid 50mg generic buy azathioprine for sale imuran tablet

  61. Eudfyw说道:

    internet roulette synthroid 150mcg canada levoxyl buy online

  62. Venjcf说道:

    buy amantadine 100mg generic order amantadine 100 mg without prescription purchase aczone for sale

  63. Saaaob说道:

    legitimate online slots for money real casino games ivermectin cream canada cost

  64. Nlvdda说道:

    purchase protonix sale order phenazopyridine 200 mg generic pyridium order

  65. Pwhjif说道:

    casino free spin albuterol order order albuterol 2mg without prescription

  66. Jenrws说道:

    free casino games best online poker sites for real money buy generic lasix diuretic

  67. Ibfxxf说道:

    order generic atorvastatin 80mg purchase proventil without prescription purchase norvasc generic

  68. Ktorar说道:

    buy generic azithromycin over the counter buy omnacortil sale gabapentin 800mg us

  69. Egwdlc说道:

    accutane 10mg uk order amoxil 500mg generic buy zithromax 500mg generic

  70. Buvqvz说道:

    cefdinir pills cefdinir pills order prevacid 30mg online

  71. Cnvprl说道:

    buy modafinil 100mg promethazine without prescription deltasone cheap

  72. Qumcxg说道:

    cenforce where to buy order aralen 250mg chloroquine 250mg sale

  73. Gdkstl说道:

    buy generic micardis over the counter order generic plaquenil molnupiravir 200mg us

  74. Hiowjh说道:

    order tadalafil 10mg online sildenafil generic viagra pill

  75. Aryuuw说道:

    prilosec for sale online order prilosec sale lopressor 100mg usa

  76. Qturuv说道:

    premarin 600 mg generic premarin 0.625mg cheap buy viagra 100mg sale

  77. Vcaxee说道:

    buy zovirax eye drop for sale order zovirax online cheap order rivastigmine 6mg for sale

  78. Mcpglq说道:

    buy generic vasotec buy cheap lactulose buy duphalac generic

  79. Vbakay说道:

    ferrous pill risedronate 35 mg us sotalol online buy

  80. Fdlxac说道:

    pyridostigmine 60 mg without prescription cheap mestinon 60mg buy generic maxalt 5mg

  81. Eeotis说道:

    order prasugrel sale brand prasugrel 10 mg tolterodine us

  82. Hdvrih说道:

    etodolac 600mg cost buy mebeverine no prescription cilostazol online order

  83. Ftylle说道:

    buy generic florinef 100 mcg florinef 100 mcg canada buy cheap generic imodium

  84. Nkwfhm说道:

    dydrogesterone pills januvia 100mg canada purchase empagliflozin pills

  85. Lrgyff说道:

    order dipyridamole for sale order generic felodipine 10mg order pravastatin 10mg online cheap

  86. Zplopp说道:

    order melatonin 3mg online cheap danazol without prescription danazol 100mg capsules

  87. Wpihst说道:

    order aspirin 75mg for sale order generic imiquimod buy zovirax medication

  88. Aosdie说道:

    purchase acarbose online cheap prandin usa griseofulvin 250mg cost

  89. Dfesoc说道:

    mintop medication buy cheap generic tamsulosin buy generic ed pills over the counter

  90. Frkfde说道:

    buy ketotifen buy imipramine without a prescription buy tofranil generic

  91. Vntysw说道:

    order tadalafil 20mg online cheap viagra 50mg tablet viagra next day

  92. Vgaozq说道:

    buy fenofibrate 200mg sale order fenofibrate online cheap buy generic tricor 160mg

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

CAPTCHAis initialing...