Не сте регистриран! Регистрирайте се БЕЗПЛАТНО, за да използвате услугите на сайта!

 Приветствие на сайта
Автор  eminem (19.03.2005 15:26) съобщение до автора
Погледнат  826 пъти добави към любими
Оценка добави коментар
Гласове  -- изпрати на приятел
Коментари  (0) абонирай се за JavaScript
     
eminem
     
 

Благодарение на този скрипт ще можете да направите доста добро приветствие на сайта ви. Когато се зареди страницата ще излезе промт, на който ще пише да си напишете името. Като го напишете страницата ще се зареди и ще излезе голям надпис "ДОБРЕ ДОШЛИ В САЙТА, <imeto>.Можете да промените текста. Ето ви кода:

Кодът трябва да се сложи в BODY тага

CODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
=============================================================
chast 1
==============================================================
<
SCRIPT>
function getname(){
//
this is the name of the function
var thiscookie
=document.cookie;
//
this retrieves the cookie
var location
=thiscookie.indexOf("surfername=");
//
this is the location of where the information starts
var endlocation
=thiscookie.indexOf(":");
//
this is the location of the end of the information
if (location != -1){
//
this checks to see if the cookie exists
var begin=location+11;
//
this gets the location of the begining of the surfer's name
var
yourname=thiscookie.substring(begin, endlocation);
//
this grabs the value from the cookie
yourname = unescape(yourname);
//
this unencodes the surfer's name
return yourname;
//
this returns the surfer's name
}
else{
var yourname = prompt("Добре дошли, моля напишете си името.",'');
//
this asks for the name
document.cookie = "surfername=" + escape(yourname)+":" + "expires=Fri Dec 10 11:00:00 PST 1999";
//
the above line sets the cookie with a name=value pair of surfername=value
//
you may modify the expiration date by changing the expires=
}
return yourname; //this returns the surfer's name
}
</
SCRIPT>

=====================================================
chast 2
==========================================================
<
SCRIPT>
document.write("Добре дошли в сайта, " + getname() + "!");
</
SCRIPT>

Дано ви хареса!



Ключови думи: java script sript скрипт приветствие сайт ДОБРЕ ДОШЛИ В САЙТА




 1 посетител чете този скрипт (0 потребители и 1 гост)  
Активни потребители: ---
   
  

Еmail  
 

 

 
  • Интересно от Софтуер
 
  • Интересно от myLINKS
 
 
 
 



IT-PLACE.NET © 2004 - 2008