开发者

Store the function returned value in a database

开发者 https://www.devze.com 2023-03-13 18:23 出处:网络
I am trying to send the value returned by a function to a database using client-server model. I am using Javascript as my client model. How can I connect to a server to send my data to the database.

I am trying to send the value returned by a function to a database using client-server model. I am using Javascript as my client model. How can I connect to a server to send my data to the database.

For example; from the below code, I want to开发者_开发问答 store abc in the database.

<blink>
<html>
<head><script>

var t = "abc";
function test(){
return t;}      // RETURNED VALUE WILL BE "abc"

</script></head>

<body onload = "test()">
</body></html>
</blink>


You cannot interface with a database server directly with Javascript. You would need to use some sort of server side script like ASP.NET, PHP, Java, etc.


Reply in answer of your comment concerning AJAX I suggest you have a look at this: https://developer.mozilla.org/en/AJAX

0

精彩评论

暂无评论...
验证码 换一张
取 消