473,322 Members | 1,401 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,322 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();">
  24.  
I appreciate any help that I hope to receive.
Sep 8 '07 #1
1 1364
pbmods
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

4
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...
3
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...
4
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
1
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...
2
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...
1
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...
13
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...
1
chandru8
by: chandru8 | last post by:
Hi all is it possible to create a ticker in visual basic 6.0 thanks
0
menayah
by: menayah | last post by:
Hi all, How to create a Scrolling Text or a ticker in VB.NET 2.0 Web Forms?
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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 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.