Back to Top

JavaScript Ticker for Database Values

JavaScript Ticker for Database Values

Sometimes you want to read the database values in JavaScript.This article describes the real-time display of JavaScript Ticker using Database Values. Here is the one demo for testimonials(or any value) coming from databases which are display vertical ticker with the use of JavaScript.

Before we see how that demo works let’s check how we create this demo.

First of all, Create the Database Table and take fields you require if you don’t have a table yet.Use the following syntax to create the table.

After creating a table, create one page ticker.php and add the following script in Head tag as we are using script it is better to add code in Head Tag or you can add anywhere in Page as per your requirement.

Above Code will do MySQL connection and fetch the data from the database and loop the data and using that data display as ticker.Here I am adding all html content to the ​global variable as an array and for ticker display, using array value one by one. After adding above code in the head tag, Add below line in Body.

Your Ticker will be displayed within this div tag so if you change its id, change it an element in the script also.You also like to read about Lazy Load Plugin for jQuery.

That’s it and your ticker is ready and checks your ticker on the ​frontend.

Have a look at the working demo here Ticker for DB values.

Hope this small look at “Database value Ticker” has been helpful, or even introduced javascript demo to you for the first time, so you enjoyed it.

Comments (1)

  1. After reaidng you blog, I thought your articles is great! I am very like your articles and I am very interested in the field of Free trial. Your blog is very useful for me .I bookmarked your blog!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to use Pagination in CodeIgniter

Posted on 11 years ago

Bhumi