• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Real time updating javascript value to database without using php

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a textbox displaying dynamic data which changes every second. How can I save this value to my database? Here's the javascript code:



Thanks in advance.
 
Ranch Hand
Posts: 624
9
BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know JavaScript has to send the information to some server side thing who talks to the database, may be PHP or Java or .NET or anything.
I think node js talks directly to the database, but do not know much about node js.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At what point do you want the information to be sent to the server? Upon a user action? At regular intervals? Whenever the control value changes?

In all cases, you'd likely want to fire off an Ajax request to send the data to a servlet. The difference would be how and when the code that sends that request gets triggered.

(This seems to be related to your other question, so I may end up closing this topic if they get too similar.)
 
Eddie Cross
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Whenever the control value changes?



It updates every second so, yes whenever the control value changes. Can I do this using node.js?

Bear Bibeault wrote:(This seems to be related to your other question, so I may end up closing this topic if they get too similar.)


No problem. I understand.

Thank you
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eddie Cross wrote:

Bear Bibeault wrote:Whenever the control value changes?



It updates every second so, yes whenever the control value changes. Can I do this using node.js?


Odd question. Why Node.js? You mentioned in another topic that you are using servlets on the backend? Why would you change that to Node.js?

Updating on the server every second may be excessive? How may users will you have? Can your servers handle the total load?

Regardless, whenever you update the value of the text control, you can fire off an Ajax request to a servlet to save the value.

Check out jQuery and its Forms Plugin to make this almost trivial.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic