Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the search function without Refresh in AJAX

Shulou Source: shulou.com Published: 2022-06-03 19:44:09 11月12日 Update

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:

Tags: Search results search results logs code keywords keywords output documents parts functions learning input data templates content databases document templates more users Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple OPPO Reno MySQL Shulou Technology vpn