471,857 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,857 software developers and data experts.

Javascripts and databases

71
I have a javascript that scrolls through a series of "headlines" - essentially key points for the month or week for our customers, or key changes to our website, prices, etc.

right now the sctipt essentially has an array of strings that gets read into a function and changed into a line of html code.

myArray =[['link','text'],[..],..]

I would like to have this linked to a database, so that it will read the link and text fields from a table - this will make things easier to update.

Could anyone help me with the code I need to link the database through javascript? I've done it in vbscript before, but never javascript.

Thank in advance for any help you can offer.
Sep 17 '07 #1
4 991
acoder
16,027 Expert Mod 8TB
JavaScript cannot access a database, but you could use Ajax (see links in Offsite Links thread) which makes a request to a server-side script.
Sep 17 '07 #2
rsteph
71
So then I could use a server-side script to access a database, and then use Ajax to link between that include, and the javascript?

JavaScript cannot access a database, but you could use Ajax (see links in Offsite Links thread) which makes a request to a server-side script.
Sep 17 '07 #3
epots9
1,351 Expert 1GB
So then I could use a server-side script to access a database, and then use Ajax to link between that include, and the javascript?
ajax == javascript
Sep 17 '07 #4
acoder
16,027 Expert Mod 8TB
So then I could use a server-side script to access a database, and then use Ajax to link between that include, and the javascript?
In a way, yes, but not quite. The Ajax code that you would use is actually just Javascript code (as pointed out by epots9), but it does allow you access to the response from the server. This, you could then use in your non-Ajax Javascript functions/code.
Sep 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Kerberos | last post: by
2 posts views Thread by LC's No-Spam Newsreading account | last post: by
4 posts views Thread by David Virgil Hobbs | last post: by
4 posts views Thread by swayze | last post: by
2 posts views Thread by Pavils Jurjans | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.