w ktorym pliku nalezaloby umiescic skrypt java? pewnie w sekcji HEAD, moze w overall_header? pytam sie bo nie jestem pewny, a ponizszy skrypt powinien wyswietlac sie niezaleznie od podstrony na ktorej jest uzytkownik
sam skrypt wyswietla wiadomosci w pasku statusu na dole przegladarki
Kod:
<SCRIPT>
<!-- Hide from old browsers
// All you have to do is put another text in the variable message.
// Don't forget to break all lines with a ^
// When you do not place a ^ at the end of all the message, the
// message will not repeat
message = "This is another example of a simple typewriter example^" +
"You can enter an unlimited number of lines here^" +
"Please, take a look at the code for a more detailed description^" +
"Created by Michiel Steendam^" +
"This typewriter will repeat now ...^" +
"^"
scrollSpeed = 20
lineDelay = 1500
// Do not change the text below //
txt = ""
function scrollText(pos) {
if (message.charAt(pos) != '^') {
txt = txt + message.charAt(pos)
status = txt
pauze = scrollSpeed
}
else {
pauze = lineDelay
txt = ""
if (pos == message.length-1) pos = -1
}
pos++
setTimeout("scrollText('"+pos+"')",pauze)
}
// Unhide -->
scrollText(0)
</SCRIPT>
jeszcze mam podobny srypt, ale pisze, zeby w sekcji BODY tez cos wkleic - i pytanie: w ktorym miejscu?
Kod:
[b]W ramach HEAD[/b]
<SCRIPT LANGUAGE="JavaScript">
<!--
// Following COPYRIGHT Š1997 Dennis & Family. All Rights Reserved.
function snapIn(jumpSpaces,position)
{ var msg = "Welcome to My Homepage!"; var out = ""; for (var i=0; i<position; i++) { out += msg.charAt(i) } for (i=1;i<jumpSpaces;i++) { out += " " } out += msg.charAt(position); window.status = out;
if (jumpSpaces <= 1) { position++; if (msg.charAt(position) == ' ') { position++ } jumpSpaces = 100-position }
else if (jumpSpaces > 3) { jumpSpaces *= .09 } else { jumpSpaces-- } if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")"; window.setTimeout(cmd,10); } return true }
//-->
</SCRIPT>
[b]W ramach BODY[/b]
Definicję BODY należy uzupełnić poleceniem ładowania onload
<body onload="snapIn(50,0)">
MB