471,354 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Ticker dosn't work with Netscape and Mozilla

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

###########################################
....
<head>
<script language="javascript" type="text/javascript">
<!--
var delay=30;
var nextm=0;
var msg=new Array
(
'Ab sofort wieder täglich geöffnet! ',
'Montag bis Sonntag von 10 bis 23 Uhr ',
'JETZT MIT GROSSER TERASSE ! ! ! '
);

function start_ticker() {
do_ticker(msg[0], 0, 1);
}

function do_ticker(text, pos, dir) {
var out='<font face="Arial,Helvetica,MS Sans Serif"><strong><font
color="red" size=-1>'+text.substring(0, pos)+'</strong></font>';
if(navigator.appName=="Netscape")
with(document.ticker.document)
{
open(); write(out); close();
}
else
ticker.innerHTML=out;

pos+=dir;

if(pos>text.length)
setTimeout('do_ticker("'+text+'",'+pos+','+(-dir)+')', delay*1);
else
{
if(pos<0)
{
if(++nextm>=msg.length)
nextm=0;
text=msg[nextm];
dir=-dir;
}
setTimeout('do_ticker("'+text+'",'+pos+','+dir+')' , delay*3);
}
}
//-->
</script>
</head>
<body onload="start_ticker()">
<table><tr><td align="center" valign="middle"><div
id="ticker"></div></td></tr></table>
</body>
</html>

Jul 23 '05 #1
4 1713
"Nariak" <Ra*******************@t-online.de> wrote in message
news:d1*************@news.t-online.com...
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

###########################################
...
<head>
<script language="javascript" type="text/javascript">
<!--
var delay=30;
var nextm=0;
var msg=new Array
(
'Ab sofort wieder täglich geöffnet! ',
'Montag bis Sonntag von 10 bis 23 Uhr ',
'JETZT MIT GROSSER TERASSE ! ! ! '
);

function start_ticker() {
do_ticker(msg[0], 0, 1);
}

function do_ticker(text, pos, dir) {
var out='<font face="Arial,Helvetica,MS Sans Serif"><strong><font
color="red" size=-1>'+text.substring(0, pos)+'</strong></font>';
if(navigator.appName=="Netscape")
with(document.ticker.document)
{
open(); write(out); close();
}
else
ticker.innerHTML=out;

pos+=dir;

if(pos>text.length)
setTimeout('do_ticker("'+text+'",'+pos+','+(-dir)+')', delay*1);
else
{
if(pos<0)
{
if(++nextm>=msg.length)
nextm=0;
text=msg[nextm];
dir=-dir;
}
setTimeout('do_ticker("'+text+'",'+pos+','+dir+')' , delay*3);
}
}
//-->
</script>
</head>
<body onload="start_ticker()">
<table><tr><td align="center" valign="middle"><div
id="ticker"></div></td></tr></table>
</body>
</html>


[snip]

Will this help?

http://www.permadi.com/tutorial/jsTypewriter/

Note: innerHTML is not part of W3C DOM standard and might be depreceated in
the future. An example of doing the same thing as above in W3C DOM is like
below:

document.getElementById("swappable").replaceChild(
document.createTextNode("Good evening"),
document.getElementById("swappable").childNodes[0]);

That piece of code will place the text "Good evening" as the first child
element of the DIV element. To include the html tags, such as <B>, you'll
need to create another node and make the text a child of that node.
Obviously, much more effort will be required.
Jul 23 '05 #2

"McKirahan" <Ne**@McKirahan.com> schrieb im Newsbeitrag
news:du********************@comcast.com...
"Nariak" <Ra*******************@t-online.de> wrote in message
news:d1*************@news.t-online.com...
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

###########################################
...
<head>
<script language="javascript" type="text/javascript">
<!--
var delay=30;
var nextm=0;
var msg=new Array
(
'Ab sofort wieder täglich geöffnet! ',
'Montag bis Sonntag von 10 bis 23 Uhr ',
'JETZT MIT GROSSER TERASSE ! ! ! '
);

function start_ticker() {
do_ticker(msg[0], 0, 1);
}

function do_ticker(text, pos, dir) {
var out='<font face="Arial,Helvetica,MS Sans Serif"><strong><font
color="red" size=-1>'+text.substring(0, pos)+'</strong></font>';
if(navigator.appName=="Netscape")
with(document.ticker.document)
{
open(); write(out); close();
}
else
ticker.innerHTML=out;

pos+=dir;

if(pos>text.length)
setTimeout('do_ticker("'+text+'",'+pos+','+(-dir)+')', delay*1);
else
{
if(pos<0)
{
if(++nextm>=msg.length)
nextm=0;
text=msg[nextm];
dir=-dir;
}
setTimeout('do_ticker("'+text+'",'+pos+','+dir+')' , delay*3);
}
}
//-->
</script>
</head>
<body onload="start_ticker()">
<table><tr><td align="center" valign="middle"><div
id="ticker"></div></td></tr></table>
</body>
</html>


[snip]

Will this help?

Not really! I don't know what you mean!
http://www.permadi.com/tutorial/jsTypewriter/ Nice Site!!! This stuff will help me!
Thanks!!!
Note: innerHTML is not part of W3C DOM standard and might be depreceated in the future. An example of doing the same thing as above in W3C DOM is like below:

document.getElementById("swappable").replaceChild(
document.createTextNode("Good evening"),
document.getElementById("swappable").childNodes[0]);

That piece of code will place the text "Good evening" as the first child
element of the DIV element. To include the html tags, such as <B>, you'll
need to create another node and make the text a child of that node.
Obviously, much more effort will be required.

Jul 23 '05 #3
McKirahan wrote:
"Nariak" <Ra*******************@t-online.de> wrote in message
news:d1*************@news.t-online.com...
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

###########################################
...
<head>
<script language="javascript" type="text/javascript">
<!--
var delay=30;
var nextm=0;
var msg=new Array
(
'Ab sofort wieder täglich geöffnet! ',
'Montag bis Sonntag von 10 bis 23 Uhr ',
'JETZT MIT GROSSER TERASSE ! ! ! '
);

function start_ticker() {
do_ticker(msg[0], 0, 1);
}

function do_ticker(text, pos, dir) {
var out='<font face="Arial,Helvetica,MS Sans Serif"><strong><font
color="red" size=-1>'+text.substring(0, pos)+'</strong></font>';
if(navigator.appName=="Netscape")
with(document.ticker.document)
{
open(); write(out); close();
}
else
ticker.innerHTML=out;

pos+=dir;

if(pos>text.length)
setTimeout('do_ticker("'+text+'",'+pos+','+(-dir)+')', delay*1);
else
{
if(pos<0)
{
if(++nextm>=msg.length)
nextm=0;
text=msg[nextm];
dir=-dir;
}
setTimeout('do_ticker("'+text+'",'+pos+','+dir+')' , delay*3);
}
}
//-->
</script>
</head>
<body onload="start_ticker()">
<table><tr><td align="center" valign="middle"><div
id="ticker"></div></td></tr></table>
</body>
</html>


[snip]

Will this help?

http://www.permadi.com/tutorial/jsTypewriter/

Note: innerHTML is not part of W3C DOM standard and might be depreceated in


If it's not part of the standard, how can it be depreciated? :-o
the future. An example of doing the same thing as above in W3C DOM is like
below:

document.getElementById("swappable").replaceChild(
document.createTextNode("Good evening"),
document.getElementById("swappable").childNodes[0]);


Can also just change the text node's value:

<span id="z">blah</span>

<input type="button" value="Change the text" onclick="
document.getElementById('z').firstChild.data = 'new stuff';
">
<input type="button" value="Add some text" onclick="
document.getElementById('z').firstChild.data += 'more text';
">

Provided 'z' has a text node as the first child initially.
--
Zif
Jul 23 '05 #4
DU
Nariak wrote:
Dear friends of programming!

the script below only works with MSI and Opera but not with Netscape 7.x and
Mozilla 1.x!

Just want to add to Zifud excellent post. Mozilla as soon as revision
version 1.5 supports DOM 3 textContent attribute which is the exact
equivalent to MSIE's innerText.

Also, DevEdge used to have excellent articles on news tickers:

Cross-browser and web standard compliant Stock Ticker example
(http://devedge.netscape.com/toolbox/.../stock-ticker/)
for now, accessible at:
http://web.archive.org/web/200402021.../stock-ticker/

Comprehensive W3C web standard compliant alternative to <marquee>
http://devedge.netscape.com/toolbox/.../xb/xbMarquee/
http://web.archive.org/web/200402020.../xb/xbMarquee/

Note that ticker and DHTML marquee annoy users because they interfere
with peripherical vision, usually the user can not slow them down or
turn them off: so generally, they annoy users while taking, using
considerably a lot of user's system resources (cpu and RAM).

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.6 :)
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steven Green | last post: by
3 posts views Thread by Edwin Boersma | last post: by
2 posts views Thread by kelvin | last post: by
2 posts views Thread by Evan Wong | last post: by
3 posts views Thread by Dan | last post: by
10 posts views Thread by News | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.