|
Hi Guys,
I have incorporated this javascript banner news flash within my .net application, that works fine as it rotates through the news items. End users have recently asked for a next button/link that would immediately display the next item without them having to wait a few seconds. Now, the problem is that when I click on the next button, it doesn't display the next item right away, then the news items start to rotate faster and faster as I click the next button over and over... here is the layout of my silly js:
function DisplayBanner(result, context)
{
...get xml representation of banner items
...assign variables
loop();
}
function loop()
{
...go through displaying one banner item
...increment banner index
setTimeout('loop()', 10000);
}
function nextBanner()
{
...increment banner index
loop();
}
My next button calls the nextBanner() function while the DisplayBanner() function is called on page load. Could someone please-please-please tell me what is it that Im doing wrong?
Thanks for all/any help
Nila
|
|
|
|
|
If you call the loop() function more than once, you will start another loop that runs along side the one that was started initially. Each time you call the loop() function you add another loop, that's why the items rotate faster and faster.
I would suggest that you add a counter to the loop and fire it a lot more often. That way you can just zero the counter to make it skip to the next item:
var counter;
function DisplayBanner(result, context) {
...get xml representation of banner items
...assign variables
counter = 100;
loop();
}
function loop() {
counter--;
if (counter <= 0) {
...go through displaying one banner item
...increment banner index
counter = 100;
}
window.setTimeout('loop()', 100);
}
function nextBanner() {
counter = 0;
}
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa, it worked like a charm!!!
Nila
|
|
|
|
|
Dear,
I need you to help:
I want to creat a table contain more than 255 field,but
in MS Accesss it support only 255.
so how can i create?
Hy Chanhan
|
|
|
|
|
Why on earth would you need more than 255 fields? It sounds as your database design is seriously flawed...
---
b { font-weight: normal; }
|
|
|
|
|
stutter[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
There is a small difference between the threads. One is about Access and the other about MySQL.
---
b { font-weight: normal; }
|
|
|
|
|
Just want to know, it can or cannot?
|
|
|
|
|
|
Thank Guffa for giving me some idea
|
|
|
|
|
My brain hurts just thinking about it!
|
|
|
|
|
Don't think, no way to do this,
because Microsoft limit only 255 in MS ACCESS
|
|
|
|
|
Dear,
I have a serious problem with Mysql:
I want to create table contain more than 255 fields in Database.
So how can i create??
Please help me soon.
thank you .
Hy Chanhan
|
|
|
|
|
What are you holding in a DB table this big? Can you not normalise it in any way?
|
|
|
|
|
Just tell me, Can or cannot?
|
|
|
|
|
Why on earth would you need more than 255 fields? It sounds as your database design is seriously flawed...
---
b { font-weight: normal; }
|
|
|
|
|
Just want to know, it can or it cannot?
|
|
|
|
|
I haven't found the maximum number of fields.
Here is the online manual[^].
---
b { font-weight: normal; }
|
|
|
|
|
Thank Guffa, for giving me some idea.
|
|
|
|
|
Hi Guys,
I'm tryin to Post an xml string to a web service which returns an xml string use WebRequest.
I'm getting the following error.
Error in Order System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream()
Any hints tips or preferable solutions!!!!
Thanks in advance
Will
I'm a man who discovered the wheel and built the Eiffel Tower out of metal and brawn. That's what kind of man I am. You're just a woman with a small brain. With a brain a third the size of us. It's science. - Ron Burgundy - Anchorman
|
|
|
|
|
Are you doing this at work from behind a company firewall? Is so that could be the problem. I have had trouble in the past with that sort of thing.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
The web service is on port 8080 which should be ok. Can you recall waht you did to fix this problem
Will
|
|
|
|
|
I never got around the problem, and then the project got dropped anyway.
It was an experiment a couple of years ago using Microsoft's MapPoint web service.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Thanks pal just opened up the ports and that bad boy is firing on all cylinders now
Will
|
|
|
|
|
Cool!
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|