使用javascript绑定HTML页面 [英] Bind HTML page using javascript

查看:88
本文介绍了使用javascript绑定HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://tinypic.com/r/b4zqis/8



嗨。上面是我想要创建的表。公司名称,商务部门和部门我从数据库中获取。



现在通过javascript,我想用这些数据绑定页面。我的数据很好。 Problm正在设计中。请帮助

http://tinypic.com/r/b4zqis/8

Hi. Above is the table I want to create. Company name, Bussiness Unit and Department I am fetching from database.

Now through javascript, I want to bind the page with this data. I am getting the data fine. Problm is designing. Kindly help

推荐答案

Node.js,Angular.js,Knockout.js或该类型的任何其他库。



如果你真的喜欢自己做,至少使用jQuery而不是简单的javascript。



这样做的方法是创建模板元素(这当然是不可见的)然后你将通过迭代结果来填充数据。



这就是说,因为你正在使用ASP.NET ,为什么你不使用asp:Repeater,GridView或其他一些表控件并简单设置其数据源?



如果这有帮助,请花时间接受答案。谢谢。
Node.js, Angular.js, Knockout.js or any number of other libraries of that type.

If you're really into doing it yourself, at least use jQuery not plain javascript.

The way to do it is to create template element (which will of course be invisible) and which you will then fill with the data by iterating over the results.

That said, since you are working with ASP.NET, why aren't you using asp:Repeater, GridView or some other "table" control and simply set its DataSource?

If this helps, please take time to accept the answer. Thank you.


这篇关于使用javascript绑定HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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