473,378 Members | 1,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Trying to create a ticker with javascript -browser hangs

I have created a small page using html and javascript that attempts to create a ticker. I am trying to go from 0 to 9 and then repeat itself. It should go to each new value after 1 second.

Unfortunately, it simply displays 0 and hangs (shows hourglass in browser).

I am running my page on XP Professional, using javacript.

Code is as follows:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. var x = 0;
  3. function ticker()
  4. {
  5. document.write(x);
  6. x++;
  7. if ( x == 9 )
  8. {
  9. x = 0;
  10. }
  11. }
  12. function cinterval()
  13. {
  14. setInterval(function() { ctick(); }, 1000);
  15. }
  16. function ctick()
  17. {
  18. cinterval();
  19. ticker();
  20. }
  21. </script>
  22. </head>
  23. <body onload="cinterval();">
I appreciate any help that I hope to receive.
Sep 8 '07 #1
1 1368
5,821 Expert 4TB
Heya, Murray.

You're using setInterval(), which automatically keeps iterating. You're thinking of setTimeout(), which only fires once.
Sep 9 '07 #2

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

Similar topics

by: dthelwal | last post by:
I'm looking for an applet or script to feed from an RSS page (perhaps RSS 0.91) and turn its <title> and <link> entries (perhaps using <description> as well) into a scrolling news ticker where the...
by: Dan | last post by:
Hi Does anyone know of a good Javascript typewriter ticker that allows you to insert HTML into the ticker. I have found lots but when HTML is inserted, the ticker pauses at the point it reaches...
by: Nariak | last post by:
Dear friends of programming! the script below only works with MSI and Opera but not with Netscape 7.x and Mozilla 1.x! What is wrong? Please help me! Thanks Ralf
by: Kaz | last post by:
Im creating a desktop ticker in C# that I wont to be displayed running along active applications, on the right hand side of the screen My question is that when I launch my ticker, how do i adjust...
by: alex.zeta | last post by:
Hi to everybody, I need to insert into a web page a very simple "message ticker" (maybe Javascript?!) that should have the following features: - scroll multiple lines of text - the lines to...
by: David | last post by:
Hi, I have the following asp in my page, but I keep getting the following error Microsoft VBScript runtime error '800a0009' Subscript out of range: 'ticker' Please can you help me ?. Here...
by: RommelTJ | last post by:
Hi, My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the...
by: chandru8 | last post by:
Hi all is it possible to create a ticker in visual basic 6.0 thanks
by: menayah | last post by:
Hi all, How to create a Scrolling Text or a ticker in VB.NET 2.0 Web Forms?
by: rassklass | last post by:
HI all, I have designed a site found at www.pickupnewspapers.co.uk/nottinghamshire/index.html but I cant get the footer to sit stil on the page. It is because of the javascript ticker, everytime...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.