Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Update the values from Server!

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to know that I have one HTML page with simple two textbox fields. I want to know whether with the use of javascript can I update values of two text boxes(Not page) from server OR I have to use socket in JDK.
Please let me know,
Thanks in advance,
Angela
 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are asking, can you update the values after the page has been sent to the client, based on some action from the server, the answer is no. In other words, you can't send over the page, have them hit a button that processes something on the server like accessing a database, and then update the textboxes with that value, unless you go back to the server and reload that entire page.
Does that make sense. Basically, you can send over all possible answers and hold them in an array or something in javascript, and then update the textboxes on the fly based on the values in the array, but you can't go back to the server without reloading the page unless you are using an applet. HTML is static so once it is sent, can't update from server without going back to the server and resending the page.
Hope that answers your question,
Bill
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bill,
Thanks a bunch!
How's Java scripts can save all answers from server into Array? For that do I have to use serverside javascript or clientside javascript? What is difference between serverside and clientside javascript?
Thanks in advance,
Angela
 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
serverside javascript is similar to CGI or ASP or Servlets, in theory. I have never used serverside javascript, but I have used ASP and ColdFusion. When you make a request to a server for a page, before I send the page back to you I have some type of script that runs ahead of time. One thing you can do is have a database that fills an array in clientside javascript so that all of the data is sent back to the client. Don't do this for large database becuase the file would be too big, but this works good for small datasets. Then when it is on the client side, you can access the array as needed.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic