Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi to all

I am new to javascript and i want to insert data to my database using javascript.
plz help.

amit jamwal
Posted

You want to know how to talk to server(where you will push data to database) from Javascript.

There are few ways to interact with server side through client side(Javascript):
1. XMLHttpRequest[^]
2. Callback[^]
3. WebService call[^]
4. PageMethod[^]

Pick one that suits you and implement it.
 
Share this answer
 
you can use ajax ,push data to database.
jquery is simple and useful.


JavaScript
$.post('test.ashx', { parm:value   },function (back) {
 //do something
},  "json");


test.ashx code:
C#
context.Response.ContentType = "application/json";
context.Response.Write("{\"p\":\"11\",\"s\":\"22\"}");
 
Share this answer
 
v2
 
Share this answer
 
Comments
Amit Jamwal 11-Jul-12 2:44am    
sry this link is posting me to my thread.
Rahul Rajat Singh 11-Jul-12 2:44am    
The link is actually pointing to the same question above.
Amit Jamwal 11-Jul-12 2:54am    
is any one hav solution for above said problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900