Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

javascript - 仅使用PHP,JS进行实时搜索[关闭](Live Search using only PHP, JS [closed])

We just got homework to do live search, but we can't use AJAX or jQuery but neither we can use button to send a form.

(我们只是需要做功课才能进行实时搜索,但是我们不能使用AJAX或jQuery,但是我们也不能使用按钮发送表单。)

So is there any solution for this?

(那么对此有什么解决方案吗?)

  ask by Marise no Yami translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Call the function when the user types the key

(用户键入键时调用该函数)

Use JavaScript's

(使用JavaScript的)

onkeyup=“function()”

On the textbox that is taking the input and later in the function perform the required search(use php or js whatever is needed)

(在接受输入的文本框中,然后在函数中执行所需的搜索(无论需要使用php或js))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...