![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 18 Pomógł: 0 Dołączył: 17.05.2005 Skąd: Koło / Poznań Ostrzeżenie: (0%) ![]() ![]() |
Z W3School mam taki oto kod:
Kod <html> <head> <script type="text/javascript"> function whichElement(event) { var tname tname=event.srcElement.tagName alert("You clicked on a " + tname + " element.") } </script> </head> <body onmousedown="whichElement(event)"> <p>Click somewhere in the document. An alert box will alert the tag name of the element you clicked on.</p> <h3>This is a header</h3> <p>This is a paragraph</p> <img border="0" src="ball16.gif" width="29" height="28" alt="Ball"> </body> </html> niestety nie działa on pod Firefox'em! W konsoli JS wyskakuje komunikat: "Błąd: event.srcElement has no properties (...)" Pod Operą ten kod działa bardzo dobrze. Czy wie ktoś jak trzeba to przerobić, aby działało też pod Firefox'em?! |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
Jest takie magiczne urządzenie jak google. Tam jest bardzo dużo:
http://www.google.com/search?hs=PVk&hl=pl&...btnG=Szukaj&lr= po nitce do klebka: http://www.webmasterworld.com/forum91/4190.htm http://developer.apple.com/internet/webcon...ventmodels.html W ostatnim linku mówią że pod ff nie ma srcElement a jest target. Więc zrób se if, że jesli jest srcElement to srcElement, a jak nie ma to target -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]()
Post
#3
|
|
![]() Grupa: Przyjaciele php.pl Postów: 1 717 Pomógł: 0 Dołączył: 12.06.2002 Skąd: Wolsztyn..... Studia: Zielona Góra Ostrzeżenie: (0%) ![]() ![]() |
No to ja polece jeszcze www.quirksmode.org i dzial Javascript -> Events -> Event properties, jest tam opisane jak sobie radzic z eventami w wiekszosci przegladarek.
-------------------- Brak czasu :/
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 20.08.2025 - 04:52 |