我们如何使用JavaScript在数据库中插入值 [英] How we insert value in database using javascript
本文介绍了我们如何使用JavaScript在数据库中插入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用JavaScript(如文本框的onblur()事件)在数据库中插入值.
请为我提供一个小例子来理解这一点..............
I want to insert values in database using javascript like onblur() event of a text box.
plese provide me a small example to understand this..............
推荐答案
当然.步骤:
1.将onblurr事件处理程序附加到文本框.
2.在此onblurr事件附加方法中,使用传统的 XMLHttpRequest .
3.创建一个XHR并将该值发送到服务器端.捕获该值,将其插入DB中,然后将响应返回为成功还是失败.
完成.
试试吧!
Sure. Steps:
1. Attach onblurr event handler to a textbox.
2. In this onblurr event attached method, use traditional XMLHttpRequest.
3. Create a XHR and send the value to server side. Trap the value, insert it in DB and return back the response as successful or failure.
Done.
Try!
这篇关于我们如何使用JavaScript在数据库中插入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文