Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [HTML][JavaScript]Waladilator...
cycofiasz
post 19.08.2008, 15:23:13
Post #1





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

Ostrzeżenie: (0%)
-----


Witam, niedawno sprawdziłem swoją stronkę waladilatorem W3 org i wyskoczył jeden błąd, chodzi o java script:

  1. <script type="text/javascript">
  2. window.onload = init;
  3.  
  4. function init() {
  5. if (window.Event) {
  6. document.captureEvents(Event.MOUSEMOVE);
  7. }
  8. document.onmousemove = getXY;
  9. }
  10.  
  11. function getXY(e) {
  12. x = (window.Event) ? e.pageX : event.clientX;
  13. y = (window.Event) ? e.pageY : event.clientY;
  14. }
  15.  
  16. function caption(txt, tag)
  17. {
  18.  
  19. document.getElementById('cap').innerHTML=txt;
  20.  
  21. var c = 25;
  22.  
  23. if(document.documentElement.scrollTop>6 && !window.Event)
  24. {
  25. c = document.documentElement.scrollTop + 25;
  26. }
  27.  
  28. document.getElementById('cap').style.left=x-10+'px';
  29. document.getElementById('cap').style.top=y+c+'px';
  30.  
  31. document.getElementById('cap').style.visibility='visible';
  32. }
  33.  
  34. function caption_out()
  35. {
  36. document.getElementById('cap').style.visibility='hidden';
  37. }


A konkretnie o :
character "&" is the first character of a delimiter but occurred as data.if(document.documentElement.scrollTop>6 & !window.Event)


Nie wiem jak się tego pozbyć, a głupio mieć czerwone światło od w3.org. Skrypt jest od podpowiedzi pokazujących się po najechaniu myszką...
Go to the top of the page
+Quote Post
JoShiMa
post 19.08.2008, 15:27:38
Post #2





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

Ostrzeżenie: (0%)
-----


Może tak:

  1. <script language="Javascript">
  2. <!--
  3. window.onload = init;
  4.  
  5. function init() {
  6. if (window.Event) {
  7. document.captureEvents(Event.MOUSEMOVE);
  8. }
  9. ...
  10. //-->


Ten post edytował JoShiMa 19.08.2008, 15:37:46


--------------------
Go to the top of the page
+Quote Post
cycofiasz
post 19.08.2008, 15:34:05
Post #3





Grupa: Zarejestrowani
Postów: 711
Pomógł: 127
Dołączył: 5.07.2008
Skąd: Łódź

Ostrzeżenie: (0%)
-----


Oh yeah guitar.gif
This document was successfully checked as XHTML 1.0 Transitional!
Dzięki

Ten post edytował cycofiasz 19.08.2008, 15:34:59
Go to the top of the page
+Quote Post
JoShiMa
post 19.08.2008, 15:38:09
Post #4





Grupa: Zarejestrowani
Postów: 1 374
Pomógł: 149
Dołączył: 1.03.2006

Ostrzeżenie: (0%)
-----


Może być oczywiście tak jak miałes na początku

  1. <script type="text/javascript">


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 8.07.2025 - 09:12