如何在html中动态获取逐个数据 [英] how to get one by one data dynamically in html

查看:323
本文介绍了如何在html中动态获取逐个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我所有的情况是,当我输入数据并按下回车键时,我在该文本框中有一个html页面,所有与文本框数据相关的数据都应显示在html页面中一个动态。(我能够将我的访问数据库与HTML页面连接起来。)



所以我的问题是如何在HTML页面上动态地逐个呈现数据?







谢谢和问候

Indrajit

Hi
All my scenario is I have one html page in that one textbox when I enter data and press enter button, all the data related to the textbox data should display in the html page one by one dynamically.(I am able to connect my access database with HTML page).

So my question is how can I render data one by one dynamically on the HTML page ?



Thanks & Regards
Indrajit

推荐答案

因为您说您可以从Access数据库获取数据,所以您需要知道的是更新(或添加)页面内容。



方法1:DOM

研究DOM http:// www .w3schools.com / js / js_htmldom.asp [ ^ ],这也需要你学习javaScript;



基本上,你创建你的控件ols的id ='something',以便轻松指定。然后,在javaScript中,您将使用:



Since you say you can get the data from your Access database, what you need to know how to do is update (or add) page content.

Method 1: DOM
Study the DOM http://www.w3schools.com/js/js_htmldom.asp[^], which will also require you learn javaScript;

Basically, you create your controls with id='something' so that it can easily be specified. Then, in a javaScript, you'd use:

<script type="text/javascript>
  function OnSomeEvent_UpdateStuff() {
  document.getElementById("something").value="the new text"
  //  you can have many of these updates for many controls<br mode="hold" />  
} 





另一种可能性是使用AJAX并使用新更新的文本构建页面的整个部分。参考AJAX也可以在与上述链接相同的站点上获得;





这些只是几条路线;它实际上取决于你所知道的其他语言(javaScript,php等) - 或者 - 它直接指向您需要学习的语言。




HTML无法连接到数据库,您将需要服务器端脚本的帮助,如php或asp.net代码。

通常,您的html表单将传递数据(例如文本框值)到服务器端脚本然后查询数据库以检索与该值匹配的记录,然后该脚本将以HTML格式呈现这些记录并发送到您的浏览器进行显示。

阅读: php_forms [ ^ ]
HTML cannot connect to database, you will need the help of server-side script, like php or asp.net code behind.
Typically, you html form will pass the data (e.g. textbox value) to a server-side script who then queries the database to retrieve records that match the the value, this script will then render these records in HTML format and send over to your browser for display.
Read this: php_forms[^]


这篇关于如何在html中动态获取逐个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆