Click to See Complete Forum and Search --> : newbie trouble
filbo_fox
01-31-2003, 07:38 AM
Hi,
Pretty new the JS.
I've tried activating the double status bar scroller on my (hp) apache webserver - butthis doesn't load.
I've placed the code within a single HTML page, within the <HEAD> section, and the loader within the BODY TAG.
However, this doesn't load
I know JS loads because I have managed to load another JS (displays when a page was accessed) and this works fine.
Any ideas?
Many thanx in advance.
FF
Could be a few reasons, post your code!
filbo_fox
01-31-2003, 08:57 AM
Hi,
Thanks for showing an interest!
Here's the code, essentially just the script embedded into html.
I personally think there's a problem with the code as I have managed to get 2 other javascripts to work on my webserver in their simplest forms.
Many thanks again!
<HTML>
<HEAD>
<TITLE> JAVA GOGO </TITLE>
<script LANGUAGE="JavaScript">
function scrollit_r2l(seed)
{
var m1 = " offering Free Scripts ";
var m2 = " .... ";
var m3 = " Visit Us Now! ";
var m4 = " Youm may add as many messages as you like! ";
var m5 = " LOOOK........ Great!! ";
var msg=m1+m2+m3+m2+m4+m2+m5;
var out = "Javascript Source ";
var c = 1;
if (seed > 100) {
seed--;
var cmd="scrollit_r2l(" + seed + ")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit_r2l(100)",75);
}
}
}
</script>
</HEAD>
<BODY onLoad="timerONE=window.setTimeout('scrollit_r2()">
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.84 KB -->
</BODY>
</HTML>
Here we go, tell me if it works!
<script LANGUAGE="JavaScript">
function scrollit_r2l(seed)
{
var m1 = " offering Free Scripts ";
var m2 = " .... ";
var m3 = " Visit Us Now! ";
var m4 = " Youm may add as many messages as you like! ";
var m5 = " LOOOK........ Great!! ";
var msg=m1+m2+m3+m2+m4+m2+m5;
var out = "Javascript Source ";
var c = 1;
if (seed > 100) {
seed--;
var cmd="scrollit_r2l(" + seed + ")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo= setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
var cmd="scrollit_r2l(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo= setTimeout("scrollit_r2l(100)",75);
}
}
}
</script>
</HEAD>
<BODY>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 1.84 KB -->
</BODY>
<script language="JavaScript">
<!--
scrollit_r2l(50);
//-->
</script>
</HTML>
filbo_fox
03-07-2003, 07:14 AM
Thanks - I will give this a go.
Many thanks in advance for your help.
FF