简体   繁体   English

如何从jquery文件中的数据库中获取数据

[英]How to fetch data from database in jquery file

I have a js file that is using an image array . 我有一个使用图像数组的js文件。 in that array there is name of images that are to be used on client side page. 在该数组中,有要在客户端页面上使用的图像的名称。 I want that image name from database. 我想要数据库中的图像名称。 I am using asp.net technology. 我正在使用asp.net技术。 Please help me out. 请帮帮我。

Please use JQuery for the same. 请使用相同的JQuery。 Use http://api.jquery.com/jQuery.ajax/ link for reference. 使用http://api.jquery.com/jQuery.ajax/链接作为参考。

Create Handler in asp.net I mean create .ashx file. 在asp.net中创建处理程序,我的意思是创建.ashx文件。 Put the server side code as you like and get the image name from database. 根据需要放置服务器端代码,并从数据库中获取映像名称。

Call Handler file using Jquery $ajax api and get the result as you required. 使用Jquery $ ajax api调用Handler文件,并根据需要获取结果。

Please let me know if you have any problem. 如果您有任何问题,请告诉我。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM