node js, json, sql, tables - javascript

hey everyone I am working with nodejs and express framework. I am trying to design a client side page which can be used to enter the form data into database i.e Mysql.So far I have succeeded to enter and retrieve the data from the database. Now I want to show this result in a tabular form where I can edit or delete the records dynamically. But I am unable to arrange the data into datatables. I am using json.stringify to pass the results to client side. The results are showing in this manner <"result:323 id=:321">

You can send the html page with the desired table as response instead of <"result:323 id=:321">. This is not advisable, though. Please refer to client side scripting tools like angularjs or reactjs

Related

get data of mysql database and display on html page

My Question is simple: which programming language do you recommand me to do what I want below.
I have an html page and some javascript. On the html page you see a card game and some actions of the card. In my javascript I hardcoded for the moment the cards of every players. In the future I don't want hardcoded decks. I want to get the info of which players has which cards in his hand from a mysql database.
I don't think javascript (or jquery) is the way to do it. What do you recommand me to use?
I think you need Ajax Calls, a MySQL database with phpmyAdmin for example and some php.
Ajax 101: https://gist.github.com/joelrojo/c54765a748cd87a395a2b865359d6add
You can consider nodejs. The package mysql can allow you to insert data into the database and read them when needed.
https://www.npmjs.com/package/mysql
Use PHP to retrieve info of which players has which cards in his hand from your MySQL database.
For further reference please refer http://php.net/docs.php

Query MongoDb with Java and pass it to d3/javascript?

I want to create a chart where I can select a time period and query mongodb accordingly. I want to use Java to query MongoDb. I know how to connect MongoDb and Java but I'm not so clear about linking the java to my webpage(i.e. To pass the data from that java file to my webpage/javascript).
I know Ajax calls can be used to link to servlets, but I'm sort of lost. Please help.
You use the Java MongoDB driver to connect to and query MongoDB from within your Java application. https://docs.mongodb.org/getting-started/java/client/
You would make that data available to the browser (D3/JavaScript) the same way you would make any server-side data available to the browser. You could either add that data to the page as you are rendering the actual webpage, or you could return the data in response to an AJAX request.

getting data from database and displaying on another page

***** COMPLETE MODIFICATION OF THE PREVIOUS QUESTION ******
I have been developing an appointment system over the past few weeks using php, mysql and javascript. I've come across a problem when trying to insert data into a table. I am using javascript on a php page to send a GET request to a php file which generates a table from database records. I have
I can't understand some of questions but as far as I know you want to call a data from the page?
You want to call the data from the specific users? If yes, you must use $_GET to get ID then you can call the data you want.
Please elaborate more regarding your question.

Return data from SQL based on user input without reloading form - Classic ASP

I am working on adding a new feature to an existing Classic ASP application. In this feature the user will scan a bar-code which will input its value into a text field in a form within a bootstrap modal. The scanner is configured to send a TAB as well after the data.
What I need is a way to query the database on field exit and populate other fields in the modal with data from the query that is based on the scanned value. I need to do this without reloading the page or closing the modal so the user can verify this information and make changes before saving the form.
What is the best way to do this? I have no issue writing the SP, but do not have any idea how to call it and then return it's values. Can I possibly use JavaScript/PHP for this?
You will need to use some ajax
https://learn.jquery.com/ajax/
Basically you would send a request to your .asp script which will run the stored procedure then send a response using Response.Write.
Then parse that response in jquery.
Unlike ASP Classic, AJAX is a new technology so it works better with JSON.
There aren't many JSON libraries
You can use json2.asp:
https://github.com/nagaozen/asp-xtreme-evolution/blob/master/lib/axe/classes/Parsers/json2.asp
Or if you want you can try it XML, but its unpopular these days and more tedious to parse.
You mentionned PHP, that's not a bad idea because, it's all built in for you see:
http://php.net/manual/en/function.json-encode.php
Hope this helps

Create html page dynamically client side using javascript/jquery/any..if not possible how to do it server side using php/ajax/java

I have a page that accepts user data (3 input fields) and an image,
On click of submit button,i need to store image and 3 input fields in some variables.
Retrieve the variable data and embed in a html table and display the image below that
Need to store this dynamic html in client side
is it possible in javascript/jquery / any at client side...
If its not possible
what are the tools that are required to do it in server side using
php/ajax/java...
how to do it also if possible
I have RAD installed,do i need anything else like sql server..
can we use something simple sql server
I would recommend looking into Underscore templates if you need client-side dynamic HTML.

Categories

Resources