0

can java script directly read data from sql server

many time i saw javascript call any server site language page, for getting data from server is this is essential or java script can read data without using any server site language

16th May 2017, 3:27 AM
Manoj singh jalal
Manoj singh jalal - avatar
3 Réponses
+ 8
Javascript? I thought it is a client side scripting language. It is Java or PHP which fetch data from sql server...
16th May 2017, 3:32 AM
Sachin Artani
Sachin Artani - avatar
+ 5
Javascript runs from client and Sql is resided in server. Client and server are in 2 different location, which are connected to each other through internet or network. Javascript can get data from Sql by using Ajax call to Server script like PHP, server script then fetch data from Sql and response the data back to the requested client. Ajax(Javascript on client) would then get the data from the callback function .
16th May 2017, 3:59 AM
Calviղ
Calviղ - avatar
+ 4
using a nodejs server you can access sql db using js, but always server side. If you intend to access a db with js client side, bypassing the server, it is not doable.
16th May 2017, 4:16 AM
seamiki
seamiki - avatar