Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770
Форумы портала PHP.SU :: Версия для печати :: Скрипт
Форумы портала PHP.SU » PHP » Напишите за меня, пожалуйста » Скрипт

Страниц (1): [1]
 

1. n1k1tos - 21 Сентября, 2009 - 17:36:47 - перейти к сообщению
Здравствуйте. вот у меня скрипт автоперехода
CODE (text):
скопировать код в буфер обмена
  1. <script>
  2. if (parent.length<1 || parent.location.toString().indexOf()==-1)
  3.  window.location="http://site"
  4. </script>

как мне сделать таймер на него? чтобы автопереход выполнялся допустим через 5 секунд. или подскажите какой нибуть другой скрипт.
2. Dekker8 - 21 Сентября, 2009 - 18:15:33 - перейти к сообщению
Вот попробуй вот етот скрипт:

CODE (text):
скопировать код в буфер обмена
  1.  
  2.  
  3. <body>
  4.  
  5. <script type="text/javascript">
  6.  
  7. function msg()
  8. {
  9. location.href = "www.google.ru";
  10. }
  11.  
  12. function set_tmr()
  13. {
  14. setTimeout("msg()", 5000);
  15. }
  16.  
  17.  
  18. </script>
  19. <form id="form1" name="form1" method="post" action="">
  20.   <label>
  21.   <input type="button" name="ertertert" id="ertertert" value="Button" onclick="set_tmr()" />
  22.   </label>
  23. </form>
  24. </body>
  25.  
  26.  
  27.  
  28.  
  29.  

(Добавление)
Функция setTimeout() ето и есть таймер в Javascript

вот кстати и статья интересная на ету тему

http://www[dot]rusdoc[dot]ru/articles/ka[dot][dot][dot]avascript/17239/
3. n1k1tos - 21 Сентября, 2009 - 20:40:08 - перейти к сообщению
блин что то не получается установить его Огорчение
4. Dekker8 - 21 Сентября, 2009 - 22:43:25 - перейти к сообщению
вот рабочий Улыбка)))
CODE (text):
скопировать код в буфер обмена
  1.  
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>Untitled Document</title>
  8. </head>
  9.  
  10. <body>
  11.  
  12. <script type="text/javascript">
  13.  
  14. function msg()
  15. {
  16. location.href = "http://www.google.ru";
  17. }
  18.  
  19. function set_tmr()
  20. {
  21. setTimeout("msg()", 5000);
  22. }
  23.  
  24.  
  25. </script>
  26. <form id="form1" name="form1" method="post" action="">
  27.   <label>
  28.   <input type="button" name="ertertert" id="ertertert" value="Button" onclick="set_tmr()" />
  29.   </label>
  30. </form>
  31. </body>
  32. </html>
  33.  
  34.  
  35.  
  36.  

 

Powered by ExBB FM 1.0 RC1