简体   繁体   中英

Javascript (client-side): Database query and Data handling

I have built a web application that accepts a Member_ID # from the client (javascript). The Member_ID is stored as a var in my javascript… now I need to make queries with it…first query to get member information (name) and then join tables to gather information for health plans that the member is elligible under … and so on.

As far as I can remember the concept is… send a async request to the server and wait for a response, once the response is received, store it and then parse it to extract useful information.

The end goal is to use the 'useful' information to plot graphs using HTML5 Canvas.

I need some direction with how to make the query? because when I read this forum, it is recommended that client-side query is 'bad' for a plethora of reasons.

Since most of my stuff is happening in the client side... few things in C# asp.net...how do I proceed?

It is also important to note that the web application should be accessible via the internet. outside the local network.

Does it make sense to Call a Web Service from the Client Side Using the AJAX Extension Toolkit??

You must handle it server side. Think about the ajax request as a simple POST or GET in the format of ?member_id=123&time=321 pointed at your handler file.

In your handler file you can construct your query from the request variables, execute it, and give a response by printing to the screen in either JSON or XML format.

Take a look here:

http://api.jquery.com/jQuery.ajax/

http://api.jquery.com/jQuery.getJSON/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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