PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
kristian
Forum Newbie
Posts: 10 Joined: Tue Jul 29, 2003 1:21 pm
Post
by kristian » Thu Oct 09, 2003 7:06 am
I have a nice dhtml ticker script that I want to be updated from the database.
Any ideas how I database drive a .js file???
Nay
Forum Regular
Posts: 951 Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia
Post
by Nay » Thu Oct 09, 2003 7:32 am
Javascript can't connect to a database on the server. You'll have to use php to output the Javascript before it gets processed by the browser.
It'll only refresh every time you refresh the file/page.
-Nay
kristian
Forum Newbie
Posts: 10 Joined: Tue Jul 29, 2003 1:21 pm
Post
by kristian » Thu Oct 09, 2003 7:56 am
Would you use PHP to output to the .js file itself. Or would it be better to just inlcude the javascript output directly into the page source.
Nay
Forum Regular
Posts: 951 Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia
Post
by Nay » Thu Oct 09, 2003 8:30 am
I'd say use a .js file if it's not a simple code (validation, etc).
-Nay