Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> target w xhtml 1.1, problem z validowaniem kodu
orgierka
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 6.03.2004

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


wedlug specyfikacji xhtml 1.1 atrybut target w znaczniku a jest bledny.

pytanie: jak zrobic link do innej strony otwierajacej sie w nowym oknie aby kod byl zgodny z validatorem xhtml 1.1 :?:
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
GrayHat
post
Post #2





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


w <head> daj:
  1. <script type="text/javascript">
  2. <!--
  3. function externalLinks() {
  4. if (!document.getElementsByTagName) return;
  5. var anchors = document.getElementsByTagName("a");
  6. for (var i=0; i<anchors.length; i++) {
  7. var anchor = anchors[i];
  8. if (anchor.getAttribute("href") &&
  9. anchor.getAttribute("rel") == "external")
  10. anchor.target = "_blank";
  11. }
  12. }
  13. window.onload = externalLinks;
  14.  
  15. -->


a puzniej na stronie:

  1. <a href="http://www.onet.pl" rel="external">onet.pl</a>
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 6.10.2025 - 20:22