[英]How to remove html from search autocomplete input after click on search results?
I am using auto complete wordpress plugin and facing issue after clicking on searching results. 我使用自动完成的wordpress插件,并在单击搜索结果后面临问题。 After clicking on results, HTML is also inserted to input text field.
单击结果后,还将HTML插入到输入文本字段中。
How I can filter html content from this input text field? 如何从此输入文本字段过滤html内容?
Here is the URL of the website, if anyone needs to check problem. 如果有人需要检查,这里是网站的URL。
URL - http://web1.kindlebit.com/DEVELOPMENT/levi_dev/company/apple-inc/?part=key_statistics 网址-http: //web1.kindlebit.com/DEVELOPMENT/levi_dev/company/apple-inc/?part=key_statistics
Thanks, 谢谢,
I have check your website and review it. 我已经检查了您的网站并进行了审查。 There is
typo
mistake in you ul li a span
tag in search result; 您在搜索结果中
ul li a span
标签中存在typo
;
Your span
result generating like : 您的
span
结果生成如下:
<sp<span class="sa-found-text 111">an cl<span class="sa-found-text 111">a</span>ss="symbol">WYNMY</sp<span>
that cause the issue 导致问题的
I have found an answer to my question. 我找到了我问题的答案。
I removed the typo mistake error by commenting code at search-autocomplete.min.js file as below :-- 我通过注释search-autocomplete.min.js文件中的代码来消除拼写错误错误,如下所示:-
b.html(b.text().replace(new RegExp("(" + d + ")", "gi"), '$1')) b.html(b.text()。replace(new RegExp(“(” + d +“)”,“ gi”),'$ 1'))
to 至
b.html(b.text()); b.html(b.text());
and did some changes to success function to pass my desired value to input search box at 并对成功函数进行了一些更改,以将我想要的值传递给位于的输入搜索框
return{label:a.title,value:a.title,url:a.url} return {label:a.title,value:a.title,url:a.url}
to 至
return { label: a.title, value: a.id, url: a.url } 返回{标签:a.title,值:a.id,网址:a.url}
Where id is the custom key parameter passed to array containing the values. 其中id是传递给包含值的数组的自定义键参数。
Thanks 谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.