Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the search function without Refresh in AJAX

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to achieve non-refresh search function in AJAX". In daily operation, I believe many people have doubts about how to achieve non-refresh search function in AJAX. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the question of "how to achieve non-refresh search function in AJAX". Next, please follow the editor to study!

The log content data table in the database is named blog_Content, where the log ID is log_ID, the log title is log_Title, the log view page is blogview.asp, and the parameter is log logID. With these materials, you can start creating XML document templates for search results. When displaying the search results, you need to display the title of the log, as well as the ID of the log to create a link to viewing the log.

Search results template sample.xml

The code is as follows:

one

On the first experience of AJAX

Each result is a search result, and to deal with situations where no relevant content is found, I define a logid of # when the search result is empty.

After completing the XML document template, you can use ASP to dynamically generate the XML documents needed for the search results. The keywords of the search are passed by POST.

Search results output ajaxsearch.asp

The code is as follows:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report