can anyone plzzz tell how to store data at the client side using jsp's or servlets?
Store data at the client-side using jsp/servlets
Collapse
X
-
Do not use words such as 'Plzzz', 'help' and 'urgent' in your thread title. They don't make your question more likely to be answered. If anything, it's less likely to be looked at.
Can you give more information about the kind of data that you want to store? Post your code using code tags.
JavaScript cannot store data in a database (if that's what you mean), but you can use Ajax to make a request to a server-side script (in this case, a JSP servlet) to do it for you. -
Originally posted by acoderDo not use words such as 'Plzzz', 'help' and 'urgent' in your thread title. They don't make your question more likely to be answered. If anything, it's less likely to be looked at.
Can you give more information about the kind of data that you want to store? Post your code using code tags.
JavaScript cannot store data in a database (if that's what you mean), but you can use Ajax to make a request to a server-side script (in this case, a JSP servlet) to do it for you.
Kind regards,
Dmjpro.Comment
-
hi ...
what do you mean exactly with that? in scripts you may use arrays, objects wherever you want ... and i think you could store them in a cookie too ... you would need to have a json-like string that you store in a cookie ... when you reread the cookie-value you may eval it and you will have the array, object, or whatever back in your script ...
kind regardsComment
-
Originally posted by gitshi ...
what do you mean exactly with that? in scripts you may use arrays, objects wherever you want ... and i think you could store them in a cookie too ... you would need to have a json-like string that you store in a cookie ... when you reread the cookie-value you may eval it and you will have the array, object, or whatever back in your script ...
kind regards
hey hii...
i am new to JS...can u xplain me tht wid an example...how can u xactly store the data using arrays at the client side??Comment
-
hi ...
have a look at post #4 there you find a link with an example on how to use cookies.
now we set the value of the cookie to something like this:
[CODE=javascript]var cookie_value = '[1, 2, 3]';
[/CODE]
when you read this value out of the cookie you may do:
[CODE=javascript]var reread_cookie_v alue = eval(cookie_val ue);
[/CODE]
and reread_cookie_v alue now contains a javascript-array [1, 2, 3]
kind regardsComment
Comment